Incorrect import of read-package-up
Closed this issue · 3 comments
Describe the bug
import { readPackageUp } from 'read-pkg-up';
│ ^^^^^^^^^^^^^
│ SyntaxError: Named export 'readPackageUp' not found. The requested module 'read-pkg-up' is a CommonJS module, which may not support all module.exports …
│ CommonJS modules can always be imported via the default export, for example using:
│ import pkg from 'read-pkg-up';
│ const { readPackageUp } = pkg;
│ at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
│ at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
│ at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
│ at async loadESM (node:internal/process/esm_loader:28:7)
│ at async handleMainPromise (node:internal/modules/run_main:120:12)
Steps to reproduce
Install netlify cli globally with pnpm
Configuration
global with pnpm
Environment
System:
OS: macOS 14.4
CPU: (8) arm64 Apple M1 Pro
Memory: 173.03 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.5.0 - ~/Library/pnpm/node
Yarn: 1.22.22 - ~/Library/pnpm/yarn
npm: 10.2.4 - ~/Library/pnpm/npm
pnpm: 8.15.5 - ~/Library/pnpm/pnpm
bun: 1.0.33 - /opt/homebrew/bin/bun
i added "read-pkg-up": "^11.0.0" in my dev dependencies to patch the problem, but i'm not convinced about the patch
version 17.19.3 should have fix the problem but i'm also concerned in latest release https://github.com/netlify/cli/releases/tag/v17.19.3
EDIT: i am currently on v17.20.0 but v17.20.1 released 3 days ago
Please let me news if you have, thanks !
@sarahetter anyway we can push this one forward? Looks like you approved the change, but it hasn't been merged yet. This has been broken since 17.19.3
Looks like this was originally caused by a renovate update that was auto merged
Closed in #6441