Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest nightly produces "Error: Cannot find module '../native'" #8973

Closed
folknor opened this issue Apr 29, 2023 · 2 comments · Fixed by #8974
Closed

latest nightly produces "Error: Cannot find module '../native'" #8973

folknor opened this issue Apr 29, 2023 · 2 comments · Fixed by #8974

Comments

@folknor
Copy link

folknor commented Apr 29, 2023

🐛 bug report

Running parcel build using the latest nightly regiment (2.8.4-nightly.2912 + 2.0.0-nightly.1289 + 2.0.0-nightly.1287) produces the error Error: Cannot find module '../native when using latest pnpm release on Linux.

I've not tried earlier versions of pnpm, nor npm or yarn. Everything was working fine with the previous nightly builds.

🎛 Configuration (.babelrc, package.json, cli command)

package.json

{
	"name": "foo",
	"version": "1.0.0",
	"description": "",
	"scripts": {
		"clean": "rimraf dist/*",
		"copy:templates": "copyfiles -f templates/* dist/templates/",
		"copy:backend": "copyfiles -f php/* dist/php/",
		"copy:data": "copyfiles -f data/*.json dist/www/",
		"copy:php": "copyfiles -f ordre.php dist/www/",
		"copy": "pnpm run -s copy:data && pnpm run -s copy:php && pnpm run -s copy:backend && pnpm run -s copy:templates",
		"parcel:build": "parcel build index.html --no-source-maps --detailed-report 0 --target web",
		"parcel:watch": "parcel watch --detailed-report 0 --target web index.html",
		"build": "pnpm run -s clean && pnpm run -s copy && pnpm run parcel:build",
		"watch": "pnpm run -s clean && pnpm run -s copy && pnpm run parcel:watch",
		"serve": "php -S localhost:8080 -t dist/www/",
		"browser:update": "pnpm browserslist --update-db",
		"browser:gen": "echo \"module.exports = $(browserslist-useragent-regexp --allowHigherVersions);\" > js/browsertest.js",
		"css:purge": "pcss --config ./.purgecss",
		"deploy": "NODE_ENV=production pnpm run build && pnpm run css:purge"
	},
	"alias": {
		"process": "process/browser.js",
		"Buffer": "buffer",
		"buffer": "buffer"
	},
	"source": "index.html",
	"web": "./dist/www/index.html",
	"targets": {
		"web": {
			"context": "browser",
			"publicUrl": "./",
			"optimize": true,
			"outputFormat": "esmodule"
		}
	},
	"browserslist": [
		"last 10 versions",
		"not dead",
		"not IE 11",
		"supports arrow-functions",
		"supports async-functions",
		"supports calc",
		"supports canvas",
		"supports childnode-remove",
		"supports classlist",
		"supports constraint-validation",
		"supports css-backgroundblendmode",
		"supports css-gradients",
		"supports css-grid",
		"supports css-mediaqueries",
		"supports css-sticky",
		"supports css-supports-api",
		"supports css-variables",
		"supports customevent",
		"supports datauri",
		"supports dispatchevent",
		"supports domcontentloaded",
		"supports es6-module",
		"supports es6",
		"supports fetch",
		"supports flexbox",
		"supports font-loading",
		"supports fontface",
		"supports form-validation",
		"supports getboundingclientrect",
		"supports insertadjacenthtml",
		"supports json",
		"supports keyboardevent-key",
		"supports let",
		"supports multibackgrounds",
		"supports once-event-listener",
		"supports promises",
		"supports queryselector",
		"supports rem",
		"supports script-async",
		"supports svg-css",
		"supports svg-html5",
		"supports url",
		"supports urlsearchparams",
		"supports viewport-units",
		"supports woff2"
	],
	"author": "",
	"license": "ISC",
	"devDependencies": {
		"@fortawesome/fontawesome-free": "latest",
		"@parcel/config-default": "nightly",
		"@parcel/core": "nightly",
		"@parcel/compressor-brotli": "nightly",
		"@parcel/optimizer-cssnano": "nightly",
		"@parcel/optimizer-htmlnano": "nightly",
		"@parcel/optimizer-svgo": "nightly",
		"@parcel/packager-css": "nightly",
		"@parcel/packager-html": "nightly",
		"@parcel/packager-raw-url": "nightly",
		"@parcel/packager-svg": "nightly",
		"@parcel/packager-xml": "nightly",
		"@parcel/transformer-css": "nightly",
		"@parcel/transformer-html": "nightly",
		"@parcel/transformer-image": "nightly",
		"@parcel/transformer-js": "nightly",
		"@parcel/transformer-postcss": "nightly",
		"@parcel/transformer-posthtml": "nightly",
		"@parcel/transformer-raw": "nightly",
		"@parcel/transformer-sass": "nightly",
		"@parcel/transformer-webmanifest": "nightly",
		"@parcel/transformer-xml": "nightly",
		"@popperjs/core": "latest",
		"@tarekraafat/autocomplete.js": "latest",
		"animate.css": "latest",
		"animated-scroll-to": "latest",
		"autoprefixer": "latest",
		"bootstrap": "latest",
		"buffer": "^5.7.1",
		"process": "^0.11.10",
		"browserslist-useragent-regexp": "latest",
		"browserslist": "latest",
		"copyfiles": "latest",
		"dice-coefficient": "latest",
		"dompurify": "latest",
		"fabric": "latest",
		"ol": "dev",
		"opentype.js": "latest",
		"parcel": "nightly",
		"postcss-preset-env": "latest",
		"postcss": "latest",
		"rimraf": "latest",
		"sass": "latest",
		"sharp": "^0.31.3"
	}
}

.parcelrc

{
	"extends": "@parcel/config-default",
	"optimizers": {
		"*.css": [
			"@parcel/optimizer-cssnano"
		]
	}
}

😯 Current Behavior

cli output:

$ deploy

> foo@1.0.0 deploy /foo
> NODE_ENV=production pnpm run build && pnpm run css:purge


> foo@1.0.0 build /foo
> pnpm run -s clean && pnpm run -s copy && pnpm run parcel:build


> foo@1.0.0 parcel:build /foo
> parcel build index.html --no-source-maps --detailed-report 0 --target web

Error: Cannot find module '../native'
Require stack:
- /foo/node_modules/.pnpm/@parcel+node-resolver-core@2.8.4-nightly.2912_@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/node-resolver-core/lib/Wrapper.js
- /foo/node_modules/.pnpm/@parcel+node-resolver-core@2.8.4-nightly.2912_@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/node-resolver-core/lib/index.js
- /foo/node_modules/.pnpm/@parcel+package-manager@2.0.0-nightly.1289_@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/package-manager/lib/index.js
- /foo/node_modules/.pnpm/@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/core/lib/resolveOptions.js
- /foo/node_modules/.pnpm/@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/core/lib/Parcel.js
- /foo/node_modules/.pnpm/@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/core/lib/index.js
- /foo/node_modules/.pnpm/parcel@2.0.0-nightly.1287_postcss@8.4.23/node_modules/parcel/lib/cli.js
- /foo/node_modules/.pnpm/parcel@2.0.0-nightly.1287_postcss@8.4.23/node_modules/parcel/lib/bin.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1090:15)
    at Module._load (node:internal/modules/cjs/loader:934:27)
    at Module.require (node:internal/modules/cjs/loader:1157:19)
    at require (/foo/node_modules/.pnpm/v8-compile-cache@2.3.0/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/foo/node_modules/.pnpm/@parcel+node-resolver-core@2.8.4-nightly.2912_@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/node-resolver-core/lib/Wrapper.js:18:15)
    at Module._compile (/foo/node_modules/.pnpm/v8-compile-cache@2.3.0/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
    at Module.load (node:internal/modules/cjs/loader:1133:32)
    at Module._load (node:internal/modules/cjs/loader:972:12)
    at Module.require (node:internal/modules/cjs/loader:1157:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/foo/node_modules/.pnpm/@parcel+node-resolver-core@2.8.4-nightly.2912_@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/node-resolver-core/lib/Wrapper.js',
    '/foo/node_modules/.pnpm/@parcel+node-resolver-core@2.8.4-nightly.2912_@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/node-resolver-core/lib/index.js',
    '/foo/node_modules/.pnpm/@parcel+package-manager@2.0.0-nightly.1289_@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/package-manager/lib/index.js',
    '/foo/node_modules/.pnpm/@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/core/lib/resolveOptions.js',
    '/foo/node_modules/.pnpm/@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/core/lib/Parcel.js',
    '/foo/node_modules/.pnpm/@parcel+core@2.0.0-nightly.1287/node_modules/@parcel/core/lib/index.js',
    '/foo/node_modules/.pnpm/parcel@2.0.0-nightly.1287_postcss@8.4.23/node_modules/parcel/lib/cli.js',
    '/foo/node_modules/.pnpm/parcel@2.0.0-nightly.1287_postcss@8.4.23/node_modules/parcel/lib/bin.js'
  ]
}
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

@folknor
Copy link
Author

folknor commented Apr 29, 2023

As a sidenote, I've also been getting this for a week or two when I run pnpm up in all my projects that use this package list:

Didn't feel it warranted its own bug report, so just dumping it here 😄

$ pnpm up                                                                                                                                                                               ✘ 1 
 WARN  deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
 WARN  deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
Already up to date
 WARN  Issues with peer dependencies found
.
└─┬ @parcel/config-default 2.0.0-nightly.1289
  └─┬ @parcel/optimizer-htmlnano 2.0.0-nightly.1289
    └─┬ htmlnano 2.0.4
      └── ✕ unmet peer svgo@^3.0.2: found 2.8.0 in @parcel/optimizer-htmlnano

Progress: resolved 559, reused 534, downloaded 0, added 0, done
Done in 14.6s

``

@mischnic
Copy link
Member

unmet peer svgo@^3.0.2: found 2.8.0 in @parcel/optimizer-htmlnano

See #8948

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants