Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use pnpm on macOS and Linux #5259

Closed
rosen-vladimirov opened this issue Feb 20, 2020 · 0 comments
Closed

Unable to use pnpm on macOS and Linux #5259

rosen-vladimirov opened this issue Feb 20, 2020 · 0 comments
Assignees
Labels
bug build Describes issues related to build operations debug prepare Describes issues related to prepare command run Describes issues related to run command webpack
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.4.0
  • Cross-platform modules: Not applicable
  • Android Runtime: Not applicable
  • iOS Runtime: Not applicable
  • Plugin(s): Ensure you do not have webpack in your package.json

Describe the bug
When setting pnpm to be used as package-manager, the CLI is unable to run the webpack process correctly on macOS and Linux. IT fails with error:

Preparing project...
/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/webpack-cli/bin/cli.js:244
                                throw err;
                                ^

TypeError: Cannot set property 'dynamicImport' of undefined
    at injectDynamicImport (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/acorn-dynamic-import/lib/inject.js:29:31)
    at Object.<anonymous> (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/acorn-dynamic-import/lib/index.js:17:46)
    at Module._compile (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/webpack/lib/Parser.js:9:15)
    at Module._compile (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/webpack/lib/JavascriptModulesPlugin.js:7:16)
    at Module._compile (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/webpack/lib/WebpackOptionsApply.js:9:33)
    at Module._compile (/Users/vladimirov/Work/nativescript-cli/scratch/appPnpm/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Executing webpack failed with exit code 1.

To Reproduce

tns package-manager set pnpm
tns create appPnpm --js
cd appPnpm
tns prepare ios

Expected behavior
Prepare of project should succeed.

Sample project

Additional context
Works correctly on Windows. It seems the problem is caused of the way CLI starts the webpack process, i.e. with node --preserve-symlinks.... This option is not required when pnpm is used according to this comment.

@rosen-vladimirov rosen-vladimirov added bug debug webpack build Describes issues related to build operations run Describes issues related to run command prepare Describes issues related to prepare command labels Feb 20, 2020
@rosen-vladimirov rosen-vladimirov added this to the 6.4.1 milestone Feb 20, 2020
@rosen-vladimirov rosen-vladimirov self-assigned this Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build Describes issues related to build operations debug prepare Describes issues related to prepare command run Describes issues related to run command webpack
Projects
None yet
Development

No branches or pull requests

2 participants