Skip to content

Storybook breaks in newer versions of Node.js #2083

@leofarias-cpu

Description

@leofarias-cpu

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdevIndicates that the issue or pull request involves engineering considerations

Type

No type

Projects

Status

Active

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions