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

Should pnpm also install react-router-dom explicitly? #4

Open
DaveParr opened this issue Dec 27, 2023 · 0 comments
Open

Should pnpm also install react-router-dom explicitly? #4

DaveParr opened this issue Dec 27, 2023 · 0 comments

Comments

@DaveParr
Copy link

DaveParr commented Dec 27, 2023

I was working through the frontend blog and wondered if the command for pnpm was missing react-router-dom?
Currently:

Developing the UI
Install react-router-dom, react-query and axios
$ pnpm install react-query axios

and then pnpm build, I got:

❯ pnpm build

> [email protected] build /home/dave/Development/test_loco_saas/vite-project
> vite build

vite v5.0.10 building for production...
✓ 3 modules transformed.
[vite]: Rollup failed to resolve import "react-router-dom" from "/home/dave/Development/test_loco_saas/vite-project/src/main.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 "react-router-dom" from "/home/dave/Development/test_loco_saas/vite-project/src/main.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:///home/dave/Development/test_loco_saas/vite-project/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:66953:27)
    at onwarn (file:///home/dave/Development/test_loco_saas/vite-project/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vitejs/plugin-react/dist/index.mjs:250:9)
    at onRollupWarning (file:///home/dave/Development/test_loco_saas/vite-project/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:66978:9)
    at onwarn (file:///home/dave/Development/test_loco_saas/vite-project/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:66698:13)
    at file:///home/dave/Development/test_loco_saas/vite-project/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:17367:13
    at Object.logger [as onLog] (file:///home/dave/Development/test_loco_saas/vite-project/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19025:9)
    at ModuleLoader.handleInvalidResolvedId (file:///home/dave/Development/test_loco_saas/vite-project/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:17971:26)
    at file:///home/dave/Development/test_loco_saas/vite-project/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:17929:26
 ELIFECYCLE  Command failed with exit code 1.
 


 Subsequently running: pnpm install react-query axios react-router-dom and then pnpm build got a successful outcome with the expected UI and functionality.

 Hope this helps/ makes sense :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant