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

Storybook breaks in newer versions of Node.js #2083

Open
leofarias-cpu opened this issue Feb 20, 2025 · 0 comments
Open

Storybook breaks in newer versions of Node.js #2083

leofarias-cpu opened this issue Feb 20, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@leofarias-cpu
Copy link

Problem

Trying to run pnpm dev:storybook with (at least) Node 23.7 or 23.8 results in an error because module is not defined. This seems to be related to the file using both CommonJS(module.exports , require) and ESM(import) features.

Expected behavior

No response

Reproducible Example

Download Node 23.8 and try to run pnpm dev:storybook

Suggested solution

Remove the ESM import at the top of the file and replace it the equivalent CommonJS syntax:

import { dirname, join } from 'node:path'
// turns into
const { dirname, join } = require('node:path')

I have tested this locally and it does resolve the problem. Changing the file to only use ESM might be better, but i couldn't quite do it.

Additional context

No response

Package

@vtex/shoreline

Packages version

No response

Browser

Chrome

Package Manager

pnpm

@leofarias-cpu leofarias-cpu added the bug Something isn't working label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant