GithubHelp home page GithubHelp logo

"npm start" is not working about react-pwa HOT 10 CLOSED

akunal1 avatar akunal1 commented on September 17, 2024 5
"npm start" is not working

from react-pwa.

Comments (10)

tirthbodawala avatar tirthbodawala commented on September 17, 2024 2

from react-pwa.

amarshahaji avatar amarshahaji commented on September 17, 2024 2

I have resolved the same issue with writing the chokidar.js file code inside self invocable function.
It may works for you also
(function(){
var v3Err;
try {
module.exports = require("chokidar");
return;
} catch(e) {
v3Err = e;
}

var v2Err;
try {
module.exports = require("watchpack-chokidar2");
return;
} catch(e) {
v2Err = e;
}

throw new Error(
"No version of chokidar is available. Tried chokidar@2 and chokidar@3.\n" +
"You could try to manually install any chokidar version.\n" +
"chokidar@3: " + v3Err + "\n" +
"chokidar@2: " + v2Err + "\n"
)
}())

from react-pwa.

jeffwilcox avatar jeffwilcox commented on September 17, 2024 2

Hopefully this pull request is accepted at some point in watchpack... webpack/watchpack#177

from react-pwa.

sunilhari9 avatar sunilhari9 commented on September 17, 2024 2

Same for me any solution for this?

from react-pwa.

bryanltobing avatar bryanltobing commented on September 17, 2024 1

face the same issue here. is there anyone knows how to solve this problem?

from react-pwa.

p32929 avatar p32929 commented on September 17, 2024

I'm also having the same problem

from react-pwa.

akunal1 avatar akunal1 commented on September 17, 2024

Have you modified inside node_module ?

from react-pwa.

amarshahaji avatar amarshahaji commented on September 17, 2024

Have you modified inside node_module ?

yes because this is dev dependency for windows user and not found for mac user

from react-pwa.

tirthbodawala avatar tirthbodawala commented on September 17, 2024

I have upgraded the required packages, but with lack of windows system, I am not able to reproduce the issue, Also, I have added code to give priority to Chokidar v3 rather than v2 that solves the issues, please let me know if the issue persists.

from react-pwa.

946629031 avatar 946629031 commented on September 17, 2024

try this way, it seem like slove my problem

Obviously, we don't have any interest in waiting for people to 'fix' libraries that return at global scope, so using Jest means I need a way to ignore those.

Here's what I ended up doing:

1.Add a "jest" configuration to file package.json:

  "jest": {
    "transform": {
      "^.+\\.js$": "<rootDir>/.jest.transform.js"
    }
  },

2.Then in the root directory for the project I created file .jest.transform.js and placed this bit to tell Jest to tell Babel to allow return outside of functions:

const babelOptions = {
    parserOpts: {
        'allowReturnOutsideFunction': true
    },
};
module.exports = require('babel-jest').createTransformer(babelOptions);

I hope this helps someone else - I almost walked away from Jest again because of this little nuance!

https://stackoverflow.com/questions/57789431/how-do-i-fix-return-outside-of-function-when-running-a-node-js-application

from react-pwa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.