Open talaikis opened 2 years ago
I got this error when importing (or requiring) a relative path in a file that the web worker imports.
The following workaround worked for me:
const properties = require(path.join(process.cwd(), `data/file.json`));
instead of
const properties = require(`../data/file.json`));
Well, without any relative imports, it does not work with imported packages.
Issue Summary
webpack/runtime/compat The "path" argument must be of type string. Received undefined with new Worker(new URL(...)) and comlink
Actual behavior
Expected behavior
Probably should work, because nextjs build worksfine.
Steps to reproduce
Repo: https://github.com/talaikis/next-worker-comlink-repro
on deployment gives Error:
Versions
Checklist
latest
oralpha
@sls-next/serverless-component
release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the oldserverless-next.js
component and theserverless-next.js
plugin are deprecated and no longer maintained.