Import path error in Vitebuild.

Asked 1 years ago, Updated 1 years ago, 283 views

import {Calendar, momentLocalizer} from 'react-big-calendar';

An error occurred in "npm run build" when deploying to fly.io as per this document in Shopify.
Even if the import path starts with .../nodemodules/, it doesn't work.
How can I solve this problem?

https://shopify.dev/apps/deployment/web

#89.787[vite]: Rollup failed to resolve import "react-big-calendar" from "components/StayCalendar.jsx".
#89.787 This is most likely unintended because it can break your application at runtime.
#89.787 If you want to externalize this module explicitly add it to
#89.787`build.rollupOptions.external`
#89.789 error during build:
#89.789Error: [vite]: Rollup failed to resolve import "react-big-calendar" from "components/StayCalendar.jsx".
#89.789 This is most likely unintended because it can break your application at runtime.
#8 9.789 If you want to externalize this module explicitly add it to
#89.789`build.rollupOptions.external`
#89.789 at onRollupWarning (/app/frontend/node_modules/vite/dist/node/chunks/dep-689425f3.js:41797:19)
#89.789 at onwarn (/app/frontend/node_modules/vite/dist/node/chunks/dep-689425f3.js:41613:13)
#89.789 at Object.onwarn (/app/frontend/node_modules/rollup/dist/shared/rollup.js:23216:13)
#89.789 at ModuleLoader.handleResolveId(/app/frontend/node_modules/rollup/dist/shared/rollup.js:22466:26)
#89.789 at/app/frontend/node_modules/rollup/dist/shared/rollup.js:22427:26
#89.789 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/sh-cd frontend & npm install & npm run build]: exit code:1

npm

2022-10-10 01:00

1 Answers

It's a build error, so I think it's better to show package.json.

I can't understand this information well, but I think it's a dependency problem.

Anyway, react-big-calendar has react as peer dependency, so check the dependencies of package.json, and if there is no react, try npm install & & npm run build...

If you still get the same error, you should include more details.


2022-10-10 01:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.