svelte-kit-MFN Svelte Themes

Svelte Kit Mfn

Example of module not found when using the static or node adapters with yarn.

Issue

when using yarn with this framework with a dependency on openlayers, the static and node adaptors are not resolving the os references correctly.

Created this project as a quick demonstration of the build issue.

yarn dev : works fine (at least as far as I took it) yarn build:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/projects/ksgolding/playground/my-app/node_modules/ol/layer/Tile' imported from /projects/ksgolding/playground/my-app/.svelte-kit/output/server/entries/pages/index.svelte.js
Did you mean to import sgolding/playground/my-app/node_modules/ol/layer/Tile.js? # !!! MIGHT BE NOTHING, BUT NOTE sgolding/ instead of ksgolding !!!
    at finalizeResolution (internal/modules/esm/resolve.js:276:11)
    at moduleResolve (internal/modules/esm/resolve.js:699:10)

Reproduce

yarn install
yarn build

Issue can be reproduced with either the node or static-adaptor.

Environment

  • node v14.17.0
  • yarn 1.22.17
  • Redhat Linux 8

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes