How to resolve loading error - jspm

I am learning JSPM and trying to get it to work using the test code.
However, I have not been able to get this work. The error I get in the console is:
Uncaught (in promise) Error: XHR error (404 Not Found) loading http://localhost:5172/none.js(…)
The network tab shows a 404 error on none.js.
This is the line of code:
import {bootstrap} from './bootstrap';
I don't understand why this would not be found. The network tab shows that main.js is found an downloaded, but not bootstrap. This makes no sense. This is the bootstrap file which is in the 'lib' directory.

If you're using jspm, then you should have globally and locally installed jspm, and then done jspm init to create your project and then jspm install bootstrap. That should work.
See if this helps: https://github.com/caasjj/jspm-tut.git

Related

Failed to load plugin 'react' declared in 'BaseConfig » somepath\index.js': Cannot find module '../internals/a-callable'

Out of nowhere, the following errors appeared while I was trying to run yarn build on my windows machine
Failed to load plugin 'react' declared in 'BaseConfig » C:\builds\caseIsNotTheIssue\clients\react-client-app\node_modules\eslint-config-react-app\index.js': Cannot find module '../internals/a-callable'
I have tried the following:
Delete node_modules folder
Delete yarn.lock`
Update various plugins but it didn't change a thing
Update Node versions
Removing eslintConfig from package.json
Checking path upper/lower case
Nothing of the above-changed anything :|
Any idea why this error appeared and how can I try and fix it?

Not able to use opencv4nodejs in Next.js

The opencv4nodejs module is working fine but when I integrate it with next.js, it is showing the following error --
Error in ./utils
Module not found: Error: Can't resolve 'child_process' in '/Users/yathartharora/Certificate/node_modules/opencv-build/build
When I run my OpenCV part separately it is working fine but as soon as I import it in my index.js it shows an error. Can someone please help me in resolving this

How to use js-cookie in a TypeScript project?

I want to use the js-cookie library in my TypeScript project.
First, I installed the library and the typings by running npm install js-cookie #types/js-cookie --save-dev in the directory that contains node_modules and package.json. package.json now contains "#types/js-cookie": "^2.1.0" and there is a folder js-cookie in node_modules.
Then I added
import * as Cookies from "js-cookie";
[...]
Cookies.remove("token");
to my TypeScript file. WebStorm doesn't show any errors.
When I run the server, I get the following error:
fetch.js:32 GET http://localhost:8080/ui/js-cookie 404 (Not Found)
common.js:85 Uncaught (in promise) Error: Fetch error: 404 Not Found
Instantiating http://localhost:8080/ui/js-cookie
Loading http://localhost:8080/ui/src/auth/userStore.tsx
Loading src/app.tsx
at fetch.js:37
at <anonymous>
What exactly did I wrong in importing js-cookie and how can I fix it?
This problem is normally fixed by using a Task Runner to shift the actual JavaScript file from:
./node_modules/js-cookie/js-cookie.js
To (for example):
./ui/js-cookie.js
(Or a location of your choice)
This is because node_modules is normally FULL of things you wouldn't want to publish to your web server, so you shift the bits you do want to publish into a folder that you will reference at runtime.

Angular2 Socket Issue

Hi Im facing Error while working on Socket.io in Angular 2 I have imported Everything required in typings.json,System.comfig.js, and in Package.json files and im using it in .ts file by using below statement
import * as io from "socket.io-client";
everything is fine till Now when im loading the project i could see below error
(index):18 Error: (SystemJS) XHR error (404 Not Found) loading
http://localhost:1000/socket.io-client
Please Help Me
use npm install #types/socket.io-client --save
see https://github.com/angular/angular-cli/issues/1278 for more info

Unable to load node.js package

I have a node.js project where I'm trying to load and parse .xml files. In an attempt to do this, I was going to rely on the DOM Parser via the following command:
npm install xmldom
The package was successfully installed. However, when I attempt to execute my code via mocha, I get an error that says: "Error: Cannot find module 'xmldom'". My code works fine until I add the following line at the top of my code:
var dom = require('xmldom');
If I comment out the line, my code works. But, if I remove the commments, to make the code active, I get the error again. I haven't written anything to actually parse the xml file yet. I'm just trying to import the dom parser at this point.
I also tried loading the xmldom package globally with the following command:
npm install -g xmldom
That did not solve my problem either. What am I missing?
I wrote a blog post explaining what to look for when you get a Cannot find module 'xmldom' error.

Resources