You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developing GIS application using openlayer, and I have implemented rotation controller using ol-rotate-feature.
But below issues occur while 'npm run build'.
What should I do?
./node_modules/ol-rotate-feature/dist/ol-rotate-feature.umd.js
Module not found: ESM packages (ol/interaction) need to be imported. Use 'import' to reference the package instead. https://nextjs.org/docs/messages/import-esm-externals
Import trace for requested module:
./src/components/Map/Interactions.tsx
./src/pages/map-index.tsx
./node_modules/ol-rotate-feature/dist/ol-rotate-feature.umd.js
Module not found: ESM packages (ol) need to be imported. Use 'import' to reference the package instead. https://nextjs.org/docs/messages/import-esm-externals
Import trace for requested module:
./src/components/Map/Interactions.tsx
./src/pages/map-index.tsx
./node_modules/ol-rotate-feature/dist/ol-rotate-feature.umd.js
Module not found: ESM packages (ol/layer) need to be imported. Use 'import' to reference the package instead. https://nextjs.org/docs/messages/import-esm-externals
Import trace for requested module:
./src/components/Map/Interactions.tsx
./src/pages/map-index.tsx
./node_modules/ol-rotate-feature/dist/ol-rotate-feature.umd.js
Module not found: ESM packages (ol/source/Vector) need to be imported. Use 'import' to reference the package instead. https://nextjs.org/docs/messages/import-esm-externals
Import trace for requested module:
./src/components/Map/Interactions.tsx
./src/pages/map-index.tsx
./node_modules/ol-rotate-feature/dist/ol-rotate-feature.umd.js
Module not found: ESM packages (ol/geom) need to be imported. Use 'import' to reference the package instead. https://nextjs.org/docs/messages/import-esm-externals
Hello @SoleDad402 ,
as I see, your builder trying to include UMD version of the ol-rotate-feature, that is nowadays correctly works only in browser with <script> tag.
So, you need to force the builder to use ESM version from ol-rotate-feature/dist/ol-rotate-feature.esm.js.
I'm not and expert with nextjs, that is what I have found about this. Try to use this option:
// next.config.jsmodule.exports={// Prefer loading of ES Modules over CommonJSexperimental: {esmExternals: true}}
I'm developing GIS application using openlayer, and I have implemented rotation controller using ol-rotate-feature.
But below issues occur while 'npm run build'.
What should I do?
The text was updated successfully, but these errors were encountered: