Skip to content

Cannot find module error when trying to use localForage from worker #10307

@eth0fox

Description

@eth0fox

🐛 bug report

🤔 Expected Behavior

Module imports successfully - and if there is an actual issue a more relevant runtime exception is thrown.

😯 Current Behavior

Uncaught Error: Cannot find module 'j5VoO'
    at newRequire (worker.7a4fd70f.js?9b7af6674c1003ee52f29e28690d5705109330f0:74:19)
    at newRequire (worker.7a4fd70f.js?9b7af6674c1003ee52f29e28690d5705109330f0:58:18)
    at localRequire (worker.7a4fd70f.js?9b7af6674c1003ee52f29e28690d5705109330f0:144:14)
    at 3ZSAf.localforage (worker.7a4fd70f.js?9b7af6674c1003ee52f29e28690d5705109330f0:717:20)
    at newRequire (worker.7a4fd70f.js?9b7af6674c1003ee52f29e28690d5705109330f0:84:24)
    at worker.7a4fd70f.js?9b7af6674c1003ee52f29e28690d5705109330f0:191:5
    at worker.7a4fd70f.js?9b7af6674c1003ee52f29e28690d5705109330f0:210:3

💁 Possible Solution

🔦 Context

I'm working on a project that uses a SharedWorker - but trying to import localForage throws an exception.

💻 Code Sample

https://gist.github.com/eth0fox/a22103e3bdbb0c859d4647a02c832e10

🌍 Your Environment

Software Version(s)
Parcel 2.16.4
Node v25.3.0
npm/Yarn 11.7.0
Operating System macOS 15.7.5 arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions