feat: yarn with PnP support
See original GitHub issueBug Report
Ionic version:
- 5.5.0
*Note: I tried both node versions 14.16.0 and 15.8.0.
Current behavior:
Creating a new, blank Ionic React app and using the latest yarn
to initialize and run the project results in catastrophic failure related to inability to find dependencies.
For more information, see Yarn 2 βZero Installsβ documentation: https://yarnpkg.com/features/zero-installs
*Note: I did verify that the commands npm i
, npm test
, and npm start
do work correctly with the same versions without any issue.
Expected behavior:
Tests run and project starts successfully. Ideally, zero warnings (but, I recognize you donβt own the entire package dependency tree).
Steps to reproduce:
- Create a new Ionic React app:
npx ionic start helloworld blank --type=react --no-git --no-deps
cd helloworld
yarn set version berry
yarn install
yarn test
(q
to stop test βwatchβ)yarn start
Related code:
n/a
Other information:
Logsβ¦
β helloworld.app git:(main) β npx ionic start helloworld blank --type=react --no-git --no-deps
[INFO] Existing git project found (/mnt/c/Users/iseri/src/github/ourchitecture/helloworld.app). Git operations are
disabled.
β Preparing directory ./helloworld - done!
β Downloading and extracting blank starter - done!
[INFO] Next Steps:
- Go to your newly created project: cd ./helloworld
- Run ionic serve within the app directory to see your app
- Build features and components: https://ion.link/scaffolding-docs
- Run your app on a hardware or virtual device: https://ion.link/running-docs
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Ionic CLI update available: 5.4.16 β 6.13.1
The package name has changed from ionic to @ionic/cli!
To update, run: npm uninstall -g ionic
Then run: npm i -g @ionic/cli
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β helloworld.app git:(main) β mv -v helloworld/* ./
renamed 'helloworld/ionic.config.json' -> './ionic.config.json'
renamed 'helloworld/package.json' -> './package.json'
renamed 'helloworld/public' -> './public'
renamed 'helloworld/src' -> './src'
renamed 'helloworld/tsconfig.json' -> './tsconfig.json'
β helloworld.app git:(main) β rm -rf helloworld
β helloworld.app git:(main) β yarn set version berry
Resolving berry to a url...
Downloading https://github.com/yarnpkg/berry/raw/master/packages/berry-cli/bin/berry.js...
Saving it into /mnt/c/Users/iseri/src/github/ourchitecture/helloworld.app/.yarn/releases/yarn-berry.cjs...
Updating /mnt/c/Users/iseri/src/github/ourchitecture/helloworld.app/.yarnrc.yml...
Done!
β helloworld.app git:(main) β yarn install
β€ YN0000: β Resolution step
β€ YN0061: β babel-eslint@npm:10.1.0 is deprecated: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
β€ YN0032: β fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
β€ YN0032: β fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
β€ YN0061: β chokidar@npm:2.1.8 is deprecated: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
β€ YN0061: β fsevents@npm:1.2.13 is deprecated: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
β€ YN0061: β fsevents@npm:1.2.13 is deprecated: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
β€ YN0061: β @hapi/joi@npm:15.1.1 is deprecated: Switch to 'npm install joi'
β€ YN0061: β @hapi/address@npm:2.1.4 is deprecated: Moved to 'npm install @sideway/address'
β€ YN0061: β @hapi/bourne@npm:1.3.2 is deprecated: This version has been deprecated and is no longer supported or maintained
β€ YN0061: β @hapi/topo@npm:3.1.6 is deprecated: This version has been deprecated and is no longer supported or maintained
β€ YN0061: β @hapi/hoek@npm:8.5.1 is deprecated: This version has been deprecated and is no longer supported or maintained
β€ YN0061: β request@npm:2.88.2 is deprecated: request has been deprecated, see https://github.com/request/request/issues/3142
β€ YN0032: β evp_bytestokey@npm:1.0.3: Implicit dependencies on node-gyp are discouraged
β€ YN0061: β har-validator@npm:5.1.5 is deprecated: this library is no longer supported
β€ YN0061: β urix@npm:0.1.0 is deprecated: Please see https://github.com/lydell/urix#deprecated
β€ YN0061: β resolve-url@npm:0.2.1 is deprecated: https://github.com/lydell/resolve-url#deprecated
β€ YN0061: β request-promise-native@npm:1.0.9 is deprecated: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
FAIL src/App.test.tsx
β Test suite failed to run
@ionic/react-router tried to access history, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: history (via "history")
Required by: @ionic/react-router@virtual:f122e2e0fc619083f1222d16db756a72e907cbf4082314c1e6b01e0171a948d0bef8b5fc91c1be8cfe7c332f514e52c96ac625fbd90689b1d0489b9cec8f1ce7#npm:5.6.3 (via /mnt/c/Users/iseri/src/github/ourchitecture/helloworld.app/.yarn/$$virtual/@ionic-react-router-virtual-0ec5b48533/0/cache/@ionic-react-router-npm-5.6.3-734f8999e5-a4232fa611.zip/node_modules/@ionic/react-router/dist/)
Require stack:
.yarn/$$virtual/@ionic-react-router-virtual-0ec5b48533/0/cache/@ionic-react-router-npm-5.6.3-734f8999e5-a4232fa611.zip/node_modules/@ionic/react-router/dist/index.js
src/App.tsx
src/App.test.tsx
25134 | enumerable: false
25135 | };
> 25136 | return Object.defineProperties(new Error(message), {
| ^
25137 | code: { ...propertySpec,
25138 | value: code
25139 | },
at internalTools_makeError (.pnp.js:25136:34)
at resolveToUnqualified (.pnp.js:26101:23)
at resolveRequest (.pnp.js:26193:29)
at Object.resolveRequest (.pnp.js:26271:26)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 6.657 s
Ran all test suites related to changed files.
Watch Usage
βΊ Press a to run all tests.
βΊ Press f to run only failed tests.
βΊ Press q to quit watch mode.
βΊ Press p to filter by a filename regex pattern.
βΊ Press t to filter by a test name regex pattern.
βΊ Press Enter to trigger a test run.
Ionic info:
β helloworld.app git:(main) β npx ionic info
[ERROR] Error loading @ionic/react package.json: Error: Cannot find module '@ionic/react/package'
Require stack:
- /home/myuser/.npm/_npx/864a9e3c2cd0cf50/node_modules/ionic/lib/project/index.js
- /home/myuser/.npm/_npx/864a9e3c2cd0cf50/node_modules/ionic/lib/index.js
- /home/myuser/.npm/_npx/864a9e3c2cd0cf50/node_modules/ionic/index.js
- /home/myuser/.npm/_npx/864a9e3c2cd0cf50/node_modules/ionic/bin/ionic
Ionic:
Ionic CLI : 5.4.16 (/home/myuser/.npm/_npx/864a9e3c2cd0cf50/node_modules/ionic)
Ionic Framework : not installed
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v15.8.0 (/home/myuser/.nvm/versions/node/v15.8.0/bin/node)
npm : 7.5.1
OS : Linux 5.4
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:14 (3 by maintainers)
Top Results From Across the Web
Plug'n'Play | Yarn - Package Manager
Initializing PnP. PnP loose mode. Caveat. Alternatives. Compatibility Table. Native support; Support via plugins; Incompatible. Frequently Asked Questions.
Read more >feat(remix-dev): add support for Yarn 3 PnP #1316 - GitHub
I'm open for suggestions regarding the remix package issues with PnP and happy to implement them, if that will get PnP support added...
Read more >Yarn 3.0 Performances, ESBuild, Better Patches
Support for the exports field. When using Yarn 3 w/ PnP, the exports field will be properly resolved regardless of your Node version....
Read more >Pooya Parsa on Twitter: "Finally Berry (via nuxt-pnp), native ...
Finally Berry (via nuxt-pnp), native ESM and runtime typescript landing to ... feat: support plug-and-play, typescript runtime and nativeΒ ...
Read more >Compatibililty with Yarn PnP (Plug and Play) feature - YouTrack
Hello JetBrains ... Any feedback about whether you're working on this ? With PNP becoming the default option in Yarn ... Supporting an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@merceyz I noticed you are a Yarn Berry contributor, so Iβll just trust your expertise and rename π ππ»
Thanks for the issue. We do not have plans for full Yarn 2 support at the moment, but I will keep this issue open for now to gauge interest and collect feedback from the community.