histoire-dev / histoire-dev/histoire

Error: Cannot find module './shared/untyped.a47b2336.cjs'

Open
#665 1 comment 0 reactions 0 assignees View on GitHub
to triage
Dominant language
TypeScript
Stars
3.6k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

The basic example of nuxt3/histoire fails to run. The file `untyped.a47b2336.cjs` does not exist in `node_modules`.

This bug doesn't occur with `nuxt 3.8`, but is present with `3.9`.

```
/Users/sagalbot/.config/yarn/global/node_modules/.bin/pnpm run story:dev

> histoire-example-nuxt3@0.0.1 story:dev /Users/sagalbot/Sites/histoire
> histoire dev

node:internal/modules/cjs/loader:995
const err = new Error(message);
^

Error: Cannot find module './shared/untyped.a47b2336.cjs'
Require stack:
- /Users/sagalbot/Sites/histoire/node_modules/untyped/dist/index.d.cts
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Function.resolve (node:internal/modules/cjs/helpers:109:19)
at _resolve (/Users/sagalbot/Sites/histoire/node_modules/jiti/dist/jiti.js:1:251148)
at jiti (/Users/sagalbot/Sites/histoire/node_modules/jiti/dist/jiti.js:1:253746)
at /Users/sagalbot/Sites/histoire/node_modules/untyped/dist/index.d.cts:1:1147
at evalModule (/Users/sagalbot/Sites/histoire/node_modules/jiti/dist/jiti.js:1:256443)
at jiti (/Users/sagalbot/Sites/histoire/node_modules/jiti/dist/jiti.js:1:254371)
at /Users/sagalbot/Sites/histoire/node_modules/@nuxt/kit/dist/index.mjs:4:16
at evalModule (/Users/sagalbot/Sites/histoire/node_modules/jiti/dist/jiti.js:1:256443)
at jiti (/Users/sagalbot/Sites/histoire/node_modules/jiti/dist/jiti.js:1:254371) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/sagalbot/Sites/histoire/node_modules/untyped/dist/index.d.cts'
]
}

Node.js v18.12.1
 ELIFECYCLE  Command failed with exit code 1.

Process finished with exit code 1
```

### Reproduction

https://github.com/sagalbot/histoire-nuxt-issue

### System Info

```shell
System:
OS: macOS 14.2.1
CPU: (12) arm64 Apple M3 Pro
Memory: 1.29 GB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
pnpm: 8.10.2 - ~/.config/yarn/global/node_modules/.bin/pnpm
Browsers:
Brave Browser: 120.1.61.120
Chrome: 120.0.6099.234
Safari: 17.2.1
npmPackages:
@histoire/plugin-nuxt: ^0.17.8 => 0.17.8
@histoire/plugin-vue: ^0.17.8 => 0.17.8
histoire: ^0.17.8 => 0.17.8
```

### Used Package Manager

npm

### Validations

- [X] Follow our [Code of Conduct](https://github.com/histoire-dev/histoire/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/histoire-dev/histoire/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://histoire.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/histoire-dev/histoire/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/histoire-dev/histoire/discussions).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.

Contributor guide

Open the contributing guide

Research direction

Start by running story:dev in the linked histoire-nuxt-issue reproduction with Nuxt 3.9 and inspect the installed untyped package and its dependency resolution. Compare the failing setup with Nuxt 3.8 to identify the compatibility change. Done means the basic Nuxt example starts without the MODULE_NOT_FOUND error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, nuxtjs, typescript
Domain
frontend, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.