GithubHelp home page GithubHelp logo

Comments (7)

zkochan avatar zkochan commented on May 17, 2024 1

With the latest [email protected] it works with no issues at all. There are two dev deps missing from electron-react-boilerplate, even thought they are used, so I created an issue there

from pnpm.

rstacruz avatar rstacruz commented on May 17, 2024

aw man, this is a side effect of the store layout, sadly. i guess it can be worked around but it won't be pretty

from pnpm.

rstacruz avatar rstacruz commented on May 17, 2024

that project also fails to build electron-prebuilt under pnpm, still unsure why.

from pnpm.

jhen0409 avatar jhen0409 commented on May 17, 2024

that project also fails to build electron-prebuilt under pnpm, still unsure why.

I have also had electron-prebuilt problem, but I cannot be reproduce it. :\

from pnpm.

zkochan avatar zkochan commented on May 17, 2024

I think this should work from Node v6.3.0 if running node with the --preserve-symlinks flag

from pnpm.

zkochan avatar zkochan commented on May 17, 2024

I doesn't seem to be the initial problem, by I have this error in the specified project:

> [email protected] build /home/zkochan/src/test/electron-react-boilerplate
> npm run build-main && npm run build-renderer


> [email protected] build-main /home/zkochan/src/test/electron-react-boilerplate
> cross-env NODE_ENV=production node --preserve-symlinks -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.electron.js --progress --profile --colors

/home/zkochan/src/test/electron-react-boilerplate/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/index.js:600
      throw err;
      ^

SyntaxError: /home/zkochan/.pnpm/.store/flat/[email protected]/_/bin/webpack.js: 'return' outside of function (12:2)
  10 |  var localWebpack = require.resolve(path.join(process.cwd(), "node_modules", "webpack", "bin", "webpack.js"));
  11 |  if(__filename !== localWebpack) {
> 12 |      return require(localWebpack);
     |      ^
  13 |  }
  14 | } catch(e) {}
  15 | var optimist = require("optimist")
    at Parser.pp$5.raise (/home/zkochan/src/test/electron-react-boilerplate/node_modules/babel-register/node_modules/babel-core/node_modules/babylon/lib/index.js:4215:13)
    at Parser.pp$1.parseReturnStatement (/home/zkochan/src/test/electron-react-boilerplate/node_modules/babel-register/node_modules/babel-core/node_modules/babylon/lib/index.js:1905:10)
    at Parser.pp$1.parseStatement (/home/zkochan/src/test/electron-react-boilerplate/node_modules/babel-register/node_modules/babel-core/node_modules/babylon/lib/index.js:1688:19)
    at Parser.pp$1.parseBlockBody (/home/zkochan/src/test/electron-react-boilerplate/node_modules/babel-register/node_modules/babel-core/node_modules/babylon/lib/index.js:2105:21)
    at Parser.pp$1.parseBlock (/home/zkochan/src/test/electron-react-boilerplate/node_modules/babel-register/node_modules/babel-core/node_modules/babylon/lib/index.js:2086:8)
    at Parser.pp$1.parseStatement (/home/zkochan/src/test/electron-react-boilerplate/node_modules/babel-register/node_modules/babel-core/node_modules/babylon/lib/index.js:1708:19)
    at Parser.pp$1.parseIfStatement (/home/zkochan/src/test/electron-react-boilerplate/node_modules/babel-register/node_modules/babel-core/node_modules/babylon/lib/index.js:1898:26)
    at Parser.pp$1.parseStatement (/home/zkochan/src/test/electron-react-boilerplate/node_modules/babel-register/node_modules/babel-core/node_modules/babylon/lib/index.js:1686:19)
    at Parser.pp$1.parseBlockBody (/home/zkochan/src/test/electron-react-boilerplate/node_modules/babel-register/node_modules/babel-core/node_modules/babylon/lib/index.js:2105:21)
    at Parser.pp$1.parseBlock (/home/zkochan/src/test/electron-react-boilerplate/node_modules/babel-register/node_modules/babel-core/node_modules/babylon/lib/index.js:2086:8)

It is probebly babel-register related

from pnpm.

zkochan avatar zkochan commented on May 17, 2024

In scripts, I added the --preserve-symlinks option to usages of node and I changed the address of webpack from ./node_modules/webpack/bin/webpack to ./node_modules/.bin/webpack. The resulting script section is this:

  "scripts": {
    "test": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 mocha --retries 2 --compilers js:babel-register --recursive --require ./test/setup.js test/**/*.spec.js",
    "test-watch": "npm test -- --watch",
    "test-e2e": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 mocha --retries 2 --compilers js:babel-register --require ./test/setup.js ./test/e2e.js",
    "lint": "eslint --ignore-path .gitignore --format=node_modules/eslint-formatter-pretty app test *.js",
    "hot-server": "cross-env NODE_ENV=development node --preserve-symlinks --max_old_space_size=2096 -r babel-register server.js",
    "build-main": "cross-env NODE_ENV=production node --preserve-symlinks -r babel-register ./node_modules/.bin/webpack --config webpack.config.electron.js --progress --profile --colors",
    "build-renderer": "cross-env NODE_ENV=production node --preserve-symlinks -r babel-register ./node_modules/.bin/webpack --config webpack.config.production.js --progress --profile --colors",
    "build": "npm run build-main && npm run build-renderer",
    "start": "cross-env NODE_ENV=production electron ./app/",
    "start-hot": "cross-env HOT=1 NODE_ENV=development electron -r babel-register -r babel-polyfill ./app/main.development",
    "postinstall": "concurrently \"install-app-deps\" \"node --preserve-symlinks node_modules/fbjs-scripts/node/check-dev-engines.js package.json\"",
    "dev": "npm run hot-server -- --start-hot",
    "package": "npm run build && build --publish never",
    "package-win": "npm run build && build --win --x64",
    "package-linux": "npm run build && build --linux",
    "package-all": "npm run build && build -mwl",
    "cleanup": "mop -v"
  }

Now the error is different: https://gist.github.com/zkochan/12e441a550e9cbeeff163e8846209a4c

The fix for this issue might be in #463

from pnpm.

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.