https://github.com/devcsrj/sveltekit-sharp
https://github.com/devcsrj/sveltekit-sharp
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/devcsrj/sveltekit-sharp
- Owner: devcsrj
- Created: 2024-01-17T09:44:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-23T10:30:43.000Z (about 2 years ago)
- Last Synced: 2025-01-14T08:24:28.757Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://github.com/sveltejs/kit/issues/11656
- Size: 87.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Steps
Run the following:
```shell
npm install
npm run build
cd build
node .
```
Then, go to:
```
http://localhost:3000/api/demo.png
```
The above will fail with:
```
Error: Could not load the "sharp" module using the darwin-arm64 runtime
undefined: Could not dynamically require "../src/build/Release/sharp-darwin-arm64.node". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.
undefined: Could not dynamically require "../src/build/Release/sharp-wasm32.node". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.
undefined: Could not dynamically require "@img/sharp-darwin-arm64/sharp.node". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.
undefined: Could not dynamically require "@img/sharp-wasm32/sharp.node". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.
Possible solutions:
- Ensure optional dependencies can be installed:
npm install --include=optional sharp
yarn add sharp --ignore-engines
- Ensure your package manager supports multi-platform installation:
See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
npm install --os=darwin --cpu=arm64 sharp
- Consult the installation documentation:
See https://sharp.pixelplumbing.com/install
at requireSharp (file:///Users/devcsrj/Projects/devcsrj/sveltekit-sharp/build/server/chunks/_server.ts-XFgYmyCb.js:3501:10)
```
On dev mode however, it works fine with:
