Skip to content

Regression in 4.9.1 – Cannot find module (…) Did you mean to import "….js"? #542

@typeofweb

Description

@typeofweb

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I understand this is a place to report a confirmed bug (not seek debugging help)
  • I understand this is a collaborative open source project, and relies on community contributions
  • I have read and understood the Contribution guide

Minimal reproduction URL

https://stackblitz.com/edit/node-ztssub

Version

v4.9.1

Node.js version

v20.12.2

Package manager

pnpm

Operating system

macOS

Problem & expected behavior (under 200 words)

node:internal/process/esm_loader:34
      internalBinding('errors').triggerUncaughtException(
                                ^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/typeofweb/…/node_modules/next/cache' imported from /Users/typeofweb/…/src/lib/stripe/stripe.ts
Did you mean to import "next/cache.js"?
    at finalizeResolution (node:internal/modules/esm/resolve:265:11)
    at moduleResolve (node:internal/modules/esm/resolve:933:10)
    at defaultResolve (node:internal/modules/esm/resolve:1157:11)
    at nextResolve (node:internal/modules/esm/hooks:866:28)
    at S (file:///Users/typeofweb/…/node_modules/.pnpm/tsx@4.9.1/node_modules/tsx/dist/esm/index.mjs?1714890869622:2:2951)
    at nextResolve (node:internal/modules/esm/hooks:866:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:304:30)
    at handleMessage (node:internal/modules/esm/worker:196:24)
    at Immediate.checkForMessages [as _onImmediate] (node:internal/modules/esm/worker:138:28)
    at process.processImmediate (node:internal/timers:478:21) {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///Users/typeofweb/…/node_modules/next/cache'
}

Contributions

  • I'm interested in working on this issue
  • I'm willing to offer financial support

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions