[Bug] google-maps package doesn't work with yarn pnp
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 14.6k
- Forks
- 2.3k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 42
Description
Description
I have a project that uses yarn 4 workspaces with yarn PnP. After following the deck.gl developer guide for using the GoogleMapsOverlay with React, the project will no longer build. Rollup (vite) fails to resolve import "@deck.gl/google-maps".
If I try to install @deck.gl/google-maps directly, I quickly get into peerDependency hell - with Rollup complaining about several other packages, which themselves rely on others. I have not yet found any configuration that works.
I also replicated the issue within the deck.gl example directly by cloning the repo and simply switching to yarn pnp (see below).
Flavors
- Script tag
- React
- Python/Jupyter notebook
- MapboxOverlay
- GoogleMapsOverlay
- CARTO
- ArcGIS
Expected Behavior
The react google-maps example should work when using modern yarn (berry) with nodeLinker: pnp
Steps to Reproduce
setup
git clone https://github.com/visgl/deck.gl.git
cd deck.gl/examples/get-started/react/google-maps
yarn install
yarn build (this works)
enable yarn pnp
corepack enable
yarn set version berry
edit yarnrc.yml first line from nodeLinker: node-modules to nodeLinker: pnp
yarn install
yarn build (this fails)
Environment
- Framework version: deck.gl@9.1.8
- Browser: not relevant
- OS: macOS 15.3.2 (24D81)
Logs
vite v4.5.10 building for production...
✓ 3 modules transformed.
✓ built in 57ms
[vite]: Rollup failed to resolve import "@deck.gl/google-maps" from "/Users/danielloiterton/Documents/code/deck.gl/examples/get-started/react/google-maps/app.jsx".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
error during build:
Error: [vite]: Rollup failed to resolve import "@deck.gl/google-maps" from "/Users/danielloiterton/Documents/code/deck.gl/examples/get-started/react/google-maps/app.jsx".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
at viteWarn (file:///Users/danielloiterton/Documents/code/deck.gl/examples/get-started/react/google-maps/.yarn/__virtual__/vite-virtual-bb4043bf3c/8/.yarn/berry/cache/vite-npm-4.5.10-f8e2a84233-10c0.zip/node_modules/vite/dist/node/chunks/dep-add429cd.js:48219:27)
at onRollupWarning (file:///Users/danielloiterton/Documents/code/deck.gl/examples/get-started/react/google-maps/.yarn/__virtual__/vite-virtual-bb4043bf3c/8/.yarn/berry/cache/vite-npm-4.5.10-f8e2a84233-10c0.zip/node_modules/vite/dist/node/chunks/dep-add429cd.js:48251:9)
at onwarn (file:///Users/danielloiterton/Documents/code/deck.gl/examples/get-started/react/google-maps/.yarn/__virtual__/vite-virtual-bb4043bf3c/8/.yarn/berry/cache/vite-npm-4.5.10-f8e2a84233-10c0.zip/node_modules/vite/dist/node/chunks/dep-add429cd.js:47979:13)
at file:///Users/danielloiterton/.yarn/berry/cache/rollup-npm-3.29.5-4622371c71-10c0.zip/node_modules/rollup/dist/es/shared/node-entry.js:24276:13
at Object.logger [as onLog] (file:///Users/danielloiterton/.yarn/berry/cache/rollup-npm-3.29.5-4622371c71-10c0.zip/node_modules/rollup/dist/es/shared/node-entry.js:25950:9)
at ModuleLoader.handleInvalidResolvedId (file:///Users/danielloiterton/.yarn/berry/cache/rollup-npm-3.29.5-4622371c71-10c0.zip/node_modules/rollup/dist/es/shared/node-entry.js:24862:26)
at file:///Users/danielloiterton/.yarn/berry/cache/rollup-npm-3.29.5-4622371c71-10c0.zip/node_modules/rollup/dist/es/shared/node-entry.js:24822:26
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in examples/get-started/react/google-maps, inspect the example's yarnrc.yml, and reproduce the failure by switching nodeLinker from node-modules to pnp. Run yarn install and yarn build; done means the React GoogleMapsOverlay example builds successfully with Yarn Berry and nodeLinker: pnp.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, vite
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100