question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The "path" argument must be of type string or an instance of Buffer or URL (`react-dom`)

See original GitHub issue

What version of Next.js are you using?

12.0.5-canary.0-12.0.8-canary.20

What version of Node.js are you using?

14.17.0

What browser are you using?

Irrelevant

What operating system are you using?

Windows

How are you deploying your application?

Irrelevant

Describe the Bug

I updated next.js from v12.0.4 to v12.0.5-canary.0 and I got a compiling error from react-dom.

Expected Behavior

No error

To Reproduce

  1. yarn init -y
  2. yarn set version berry
  3. yarn add next@canary react react-dom
  4. Create pages folder
  5. Create next.config.js file ( reason ):
module.exports = {
  experimental: {
    swcFileReading: false
  }
}
  1. yarn next
  2. Read log:
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./.yarn/__virtual__/react-dom-virtual-3cc0bffdcb/0/cache/react-dom-npm-17.0.2-f551215af1-1c1eaa3bca.zip/node_modules/react-dom/cjs/react-dom.development.js
Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received type number (-2147483494)
    at new Promise (<anonymous>)
wait  - compiling...
error - ./.yarn/__virtual__/react-dom-virtual-3cc0bffdcb/0/cache/react-dom-npm-17.0.2-f551215af1-1c1eaa3bca.zip/node_modules/react-dom/cjs/react-dom.development.js
Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received type number (-2147483417)
    at new Promise (<anonymous>)
wait  - compiling...
error - ./.yarn/__virtual__/react-dom-virtual-3cc0bffdcb/0/cache/react-dom-npm-17.0.2-f551215af1-1c1eaa3bca.zip/node_modules/react-dom/cjs/react-dom.development.js
Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received type number (-2147483417)
    at new Promise (<anonymous>)
<w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|C:\test-nextjs\.yarn\__virtual__\react-dom-virtual-3cc0bffdcb\0\cache\react-dom-npm-17.0.2-f551215af1-1c1eaa3bca.zip\node_modules\react-dom\cjs\react-dom.development.js': No serializer registered for NodeError        
<w> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> webpack/lib/ModuleBuildError -> NodeError

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:12
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
aperalta1437commented, Dec 18, 2021

Same here. When I use Next.js v12.0.5-canary.0 or v12.0.5-canary.6, yarn dev crashes for Yarn v3 (Berry) with PnP. When I downgrade to v12.0.4, it works again. Full output of broken yarn dev after I open localhost:3000:

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
warn  - You have enabled experimental feature(s).
warn  - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.

error - ./.yarn/__virtual__/react-dom-virtual-fe01f4b047/0/cache/react-dom-npm-17.0.2-f551215af1-1c1eaa3bca.zip/node_modules/react-dom/cjs/react-dom.development.js
Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received type number (-2147483636)
    at new Promise (<anonymous>)
wait  - compiling...
error - ./.yarn/__virtual__/react-dom-virtual-fe01f4b047/0/cache/react-dom-npm-17.0.2-f551215af1-1c1eaa3bca.zip/node_modules/react-dom/cjs/react-dom.development.js
Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received type number (-2147483620)
    at new Promise (<anonymous>)
wait  - compiling...
error - ./.yarn/__virtual__/react-dom-virtual-fe01f4b047/0/cache/react-dom-npm-17.0.2-f551215af1-1c1eaa3bca.zip/node_modules/react-dom/cjs/react-dom.development.js
Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received type number (-2147483620)
    at new Promise (<anonymous>)
(node:57064) [DEP_WEBPACK_MODULE_ISSUER] DeprecationWarning: Module.issuer: Use new ModuleGraph API
(Use `node --trace-deprecation ...` to show where the warning was created)
wait  - compiling /_error (client and server)...
error - ./.yarn/__virtual__/react-dom-virtual-fe01f4b047/0/cache/react-dom-npm-17.0.2-f551215af1-1c1eaa3bca.zip/node_modules/react-dom/cjs/react-dom.development.js
Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received type number (-2147483620)
    at new Promise (<anonymous>)
Error: Qualified path resolution failed - none of those files can be found on the disk.

Source path: /path/to/project/.next/fallback-build-manifest.json
Not found: /path/to/project/.next/fallback-build-manifest.json
Not found: /path/to/project/.next/fallback-build-manifest.json.js
Not found: /path/to/project/.next/fallback-build-manifest.json.json
Not found: /path/to/project/.next/fallback-build-manifest.json.node

Require stack:
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/server/load-components.js
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/build/utils.js
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/build/output/store.js
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/build/output/index.js
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/cli/next-dev.js
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/bin/next
    at Function.external_module_.Module._resolveFilename (/path/to/project/.pnp.cjs:17279:55)
    at Function.mod._resolveFilename (/path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/build/webpack/require-hook.js:171:28)
    at Function.external_module_.Module._load (/path/to/project/.pnp.cjs:17078:48)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.loadDefaultErrorComponents (/path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/server/load-components.js:22:24)
    at DevServer.getFallbackErrorComponents (/path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/server/dev/next-dev-server.js:673:43)
    at async DevServer.renderErrorToResponse (/path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/server/next-server.js:1730:40)
    at async pipe.req.req (/path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/server/next-server.js:1670:30)
    at async DevServer.pipe (/path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/server/next-server.js:1148:25)
error - Error: Qualified path resolution failed - none of those files can be found on the disk.

Source path: /path/to/project/.next/fallback-build-manifest.json
Not found: /path/to/project/.next/fallback-build-manifest.json
Not found: /path/to/project/.next/fallback-build-manifest.json.js
Not found: /path/to/project/.next/fallback-build-manifest.json.json
Not found: /path/to/project/.next/fallback-build-manifest.json.node

Require stack:
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/server/load-components.js
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/build/utils.js
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/build/output/store.js
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/build/output/index.js
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/cli/next-dev.js
- /path/to/project/.yarn/__virtual__/next-virtual-0d318d6535/0/cache/next-npm-12.0.5-canary.6-f394586d9e-f8b75e366e.zip/node_modules/next/dist/bin/next

Running rm -rf .next && yarn dev does not help. Running yarn add next@12.0.4 && yarn dev does.

I also tried yarn set version canary && yarn install && yarn dev but this did not fix things for next@canary.

“yarn add next@12.0.4” fixed it for me. Thank you!

3reactions
kachkaevcommented, Jan 11, 2022

Looks like this issue got fixed in 12.0.8-canary.21 via https://github.com/vercel/next.js/pull/32867 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

The "path" argument must be of type string or an instance ...
The "path " argument must be of type string or an instance of Buffer or URL. Received undefined · Delete node_modules folder ·...
Read more >
typeerror: the "path" argument must be of type string or an ...
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined at Object.
Read more >
[Fix] TypeError [ERR_INVALID_ARG_TYPE]: The “path ...
[Fix] TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received undefined · This story will cover three possible fixes: · 1:...
Read more >
React Router - URL Parameters
React Router - URL Parameters. A simple example deployed using react-codesandboxer. 2.8k. 0. 0. Edit Sandbox. Files. example.js. index.html. index.js.
Read more >
Changelog
Fixed an issue with Angular Component Testing where urls within SASS/SCSS files ... parallel group parameters are mismatched when sent to the Cypress...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found