How do i fix New react app module parse failed error - reactjs

Every time when i try to create a new react-app i get this error
The only fix i have is to copy #pmmmvh and babel-loader folders from an older project and replace the one in the current project.
This works for a while, but after some time, it shows the same error

Your file path has got an unescaped ' in it: require('C:/Users/cnico/Desktop/Nicu's Stuff...'). That's probably a bug in the library that's doing this.
Try moving your project from Nicu's Stuff to another folder without a '.

Related

Next.js: ./node_modules/next/dist/client/dev/amp-dev.js

I have a very serious issue right now trying to use Next js. No matter what version I use, any time I try to run the npm run dev, I get the following error:
error - ./node_modules/next/dist/client/dev/amp-dev.js
Module not found: Can't resolve 'C:\Usersudbasili\Documents\Programming\Acumen Developers\myportfolio\node_modules\next\dist\compiled\regenerator-runtime\runtime.js' in 'C:\Users\udbasili\Documents\Programming\Acumen Developers\myportfolio\node_modules\next\dist\client\dev'
error - Error: Cannot find module 'C:\Users\udbasili\Documents\Programming\Acumen Developers\myportfolio\.next\fallback-build-manifest.json'Require stack:
This is literally right after running the create next app command, so I don't install any additional package. One thing realized though is that this error doesn't occur when I use the public folder on my window PC but when I use the user folder called udbasili I get the above error. I have been using next.js for a long time and this is the first I am seeing this error
I had the same issue
the problem was that my project files was in a folder beginning with "ud". My folder name was "udemy".
Renaming that folder or moving the project outside that folder solved the issue
If you compare the paths, there is a missing '\' :
C:\Users**\\**udbasili\Documents\Programming\Acumen Developers\...
C:\Usersudbasili\Documents\Programming\Acumen Developers\...
A quick solution that I gave to this issue was to create the project on a different path. For example:
C:\dev\myportfolio
Please head over to https://nextjs.org/docs/messages/swc-disabled
By disabling swc in next.config.js it will resolve your issue.
You can disable swc by adding:
experimental: {
forceSwcTransforms: true,
}
It's possible your autoimport included '/dist/client/dev' in the 'next/amp' path.
Does it work if you import { useAmp } from 'next/amp'?

Why can't the Web Browser find these modules, resolve, and compile the page?

In a React project, I am trying to run the app on a live server in the web browser. However when I command CD Ravenous to go to the right file and npm start, the browser gives me the following error:
./src/index.js
Module not found: Can't resolve './App' in '/Users/mauricemarkslag/ravenous/src'
I've checked if the imports have been filled in correctly, and that should be the case now I guess. However the error doesn't seem to be fixed with this code:
Code file
Folder structure
Does anybody know what I might do wrong?
You have a typo, you should use ./app.css instead of ./App.css, and I am assuming that the file that you put in your question is app.js.

failed to compile React projects

I am busy with a project of React and
When I want run a browser I get this error.
./src/Components/ui/icons.js
Module not found: Can't resolve './src/Resources/images/logos/manchester_city_logo' in 'C:\Users\Daniel\Desktop\mancity\src\Components\ui'
This error occurred during the build time and cannot be dismissed.
I made sure of correct names of folders. Is it a npm webpack?
You are most probably referring to a non-existed media file or using wrong file extension when importing manchester_city_logo (probably in icons.js)
Doublecheck the source path for desired media file in icons.js

How to prevent Create React App from forcing me to install TypeScript because a dependency has a ts file in it

I have a React app created using Create React App that was running fine until today. Something must have updated the last time I installed a new package. Anyhow, so whenever I try to start the app, it complains that there are .ts files (within node_modules folder) and forces me to install TypeScript.
Is there any way to stop this behaviour? Because currently, installing TypeScript just opens a bottle of worms, where I need to resolve the TypeScript errors that arises.
Also, as the screenshot suggests, removing the tsconfig.json file doesn't resolve the issue, it gets automatically created on every run..
Currently because it's preventing me to work, I've done the following modification until they fix it on the Create React App:
Current solution until they fix the create react app
On the file node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js, find the definition of verifyNoTypeScript() (line 24). Replace the function to the following:
function verifyNoTypeScript() {
return true;
}

A method named '/parties/insert' is already defined angular-meteor tutorials

I am new to meteor + angular and i am learning this from http://www.angular-meteor.com/
When i reach 3-way data binding section and create folder called collections in socially folder and create file called parties.ts it is giving me error i write following two lines in that file.
import {Mongo} from 'meteor/mongo';
export let Parties = new Mongo.Collection('parties');
here is the error log.
C:\<user>\AppData\Local\.meteor\packages\meteor-tool\1.3.2_4\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:245
throw(ex);
^
Error: A method named '/parties/insert' is already defined
at packages/ddp-server/livedata_server.js:1548:15
at Function._.each._.forEach (packages/underscore/underscore.js:113:1)
at Server.methods (packages/ddp-server/livedata_server.js:1544:7)
at packages/allow-deny/allow-deny.js:191:24
at [object Object].CollectionPrototype._defineMutationMethods (packages/allow-deny/allow-deny.js:190:5)
at new Mongo.Collection (packages/mongo/collection.js:226:8)
at meteorInstall.collections.parties.js (collections/parties.ts:2:22)
at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:141:1)
at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:75:1)
at collections/parties.ts:2:54
Exited with code: 8
Your application is crashing. Waiting for file change.
I hope i will get help from this community. Thanks.
I had the same problem and successfully fixed it. I was also using Atom with the Atom TypeScript plugin, which was automatically compiling the TypeScript files to JavaScript separate from Meteor and creating unnecessary files.
Here are the steps that I took to fix the problem:
Check your tsconfig.json file and make sure it has these lines (add or change them if necessary):
"buildOnSave": false,
"compileOnSave": false,
Close and restart Atom to make sure the Atom TypeScript plugin uses the new settings and stops automatically compiling TypeScript to JavaScript on save.
Delete all *.js and *.map files in your "client", "server", and "both" directories.
Stop your Meteor instance if it is currently running (probably "ctrl-c" or "command-c", depending on your OS).
Run "meteor reset" on the command line.
Run "meteor" on the command line to recompile your TypeScript files and restart Meteor.
After that, everything worked fine for me.
Problem could be sometime type script might not be compiled properly into js. Try deleting js file in that folder , edit your typescript file and save. Next recompilation should remove this error.
I have the same error. Did you ever figure it out?
I ended up solving my issue and I had to add "compileOnSave": false" to my tsconfig file. I'm using Atom and it was automatically compiling.

Resources