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
> ../../../../../usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/utils/detect_native_module.js:14:32: error: [plugin: external-native-modules] files.some is not a function
14 │ const hasBinaryFile = files.some((path) => !path.startsWith('!') && (0, path_1.extname)(path) === '.node');
╵ ^
at isNativeModule (/usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/utils/detect_native_module.js:14:33)
at /usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/esbuild/plugin_native_modules.js:17:158
at /usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/esbuild/plugin_native_modules.js:35:57
at callback (/usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/esbuild/lib/main.js:833:28)
at handleRequest (/usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/esbuild/lib/main.js:644:30)
../../../../../usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/esbuild/plugin_native_modules.js:26:14: note: This error came from the "onResolve" callback registered here
26 │ build.onResolve({ filter: packageFilter }, async (args) => {
╵ ~~~~~~~~~
at setup (/usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/esbuild/plugin_native_modules.js:26:15)
at handlePlugins (/usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/esbuild/lib/main.js:746:23)
at Object.buildOrServe (/usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/esbuild/lib/main.js:1094:7)
at /usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/esbuild/lib/main.js:1818:17
at new Promise (<anonymous>)
at Object.build (/usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/esbuild/lib/main.js:1817:14)
at build (/usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/esbuild/lib/main.js:1693:51)
at bundleJsFile (/usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/esbuild/bundler.js:60:96)
at Object.bundle (/usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/esbuild/index.js:33:150)
node_modules/imagekit/dist/utils/phash.js:7:49: note: The plugin "external-native-modules" was triggered by this import
7 │ var hamming_distance_1 = __importDefault(require("hamming-distance"));
Steps to reproduce
run https://github.com/netlify-templates/nuxt-toolbox.git
run cd nuxt-toolbox
run npm install
run npm install --save imagekit
add this line to netlify > functions > joke.js: import ImageKit from 'imagekit'
run netlify dev
Configuration
[build]
command = "npm run generate"
functions = "netlify/functions"
publish = "dist"
[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200
force = true
[functions]
node_bundler = "esbuild"
Thanks for reporting this and sorry for the wait. 💚
We were able to identify the issue and I created a PR (see comment above) in the broken repository.
We also will fix this on our end and will handle invalid package.jsons better.
Describe the bug
I'm not able to import the imagekit npm package
I tried it on my project and on the netlify nuxt-toolbox
Netlify support confirmed this might be a netlify-cli bug
I get this error:
Steps to reproduce
run
https://github.com/netlify-templates/nuxt-toolbox.git
run
cd nuxt-toolbox
run
npm install
run
npm install --save imagekit
add this line to
netlify
>functions
>joke.js
:import ImageKit from 'imagekit'
run
netlify dev
Configuration
Environment
The text was updated successfully, but these errors were encountered: