Skip to content

Bug: punycode not supported resolving ES modules #119

@MrJadaml

Description

@MrJadaml

Summary

When running storybook (Vite config) with "@storybook/experimental-addon-test": "^8.6.3", I'm unable to run the tests without it failing due to punycode error. I have three dependencies that use it, but the node-stdlib-browser/ dep that shows up in the error only exists within vite-plugin-node-polyfills dep:

➜  app git:(poc-176) ✗ npm ls punycode
[email protected] /Users/foo/code/app
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ └─┬ [email protected]
│   │   └─┬ [email protected]
│   │     └── [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   └─┬ [email protected]
│     └─┬ [email protected]
│       └── [email protected]
└─┬ [email protected]
  └─┬ [email protected]
    ├── [email protected]
    └─┬ [email protected]
      └── [email protected] deduped
3:45:14 PM [vite] (client) ✨ new dependencies optimized: vite-plugin-node-polyfills/shims/buffer, vite-plugin-node-polyfills/shims/global, vite-plugin-node-polyfills/shims/process
3:45:14 PM [vite] (client) ✨ optimized dependencies changed. reloading
storybook/test: Unhandled rejection
storybook/test: Error: Directory import '/Users/foo/code/app/node_modules/punycode/' is not supported resolving ES modules imported from /Users/foo/code/app/node_modules/node-stdlib-browser/esm/proxy/url.js
Did you mean to import "punycode/punycode.js"?
/Users/foo/code/app/node_modules/storybook/bin/index.cjs:23
  throw error;
  ^

Error: Unhandled rejection
Error: Directory import '/Users/foo/code/app/node_modules/punycode/' is not supported resolving ES modules imported from /Users/foo/code/app/node_modules/node-stdlib-browser/esm/proxy/url.js
Did you mean to import "punycode/punycode.js"?
    at ChildProcess.<anonymous> (/Users/foo/code/app/node_modules/@storybook/experimental-addon-test/dist/preset.js:32:5088)
    at ChildProcess.emit (node:events:518:28)
    at emit (node:internal/child_process:949:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:91:21)

Node.js v22.14.0 (LTS)

deprecation of punycode in node
https://nodejs.org/api/punycode.html#punycode_punycode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions