Hi,
I’m trying to update environment https://ambiente-teste.netlify.app. When building, an error always occurs with an internal Netlify function.
Error - Cannot find package ‘node-fetch-native’ imported from /var/task/src/server.mjs
Deploy errors
11:02:14 AM: ▲ [WARNING] import.meta is not available with the cjs output format and will be empty [empty-import-meta]
11:02:14 AM: .netlify/functions-internal/server/server.mjs:1:29:
11:02:14 AM: 1 │ globalThis.importMeta={url:import.meta.url,env:process.env};impor…
11:02:14 AM: ╵ ~~~~~~~~~~~
11:02:14 AM: You need to set the output format to esm for import.meta to work correctly.
11:02:14 AM: ✘ [ERROR] Could not resolve tslib
11:02:14 AM: .netlify/functions-internal/server/node_modules/ts-invariant/lib/invariant.cjs:5:20:
11:02:14 AM: 5 │ var tslib = require(‘tslib’);
11:02:14 AM: ╵ ~~~~~~~
11:02:14 AM: The module ./tslib.es6.js was not found on the file system:
11:02:14 AM: .netlify/functions-internal/server/node_modules/tslib/package.json:31:22:
11:02:14 AM: 31 │ module: ./tslib.es6.js,
11:02:14 AM: ╵ ~~~~~~~~~~~~~~~~
11:02:15 AM: ❯ Failed to bundle functions with selected bundler (fallback used):
11:02:15 AM: - server.zip
I’ve already tried deploying it, making changes to the code without success. I’ve even created a new environment doing the entire procedure from scratch and the error persists.
I am available to provide further information and clarifications.
Thanks