-
Notifications
You must be signed in to change notification settings - Fork 312
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
First up, just wanted to say how much I love ncc, it makes distributing JS code a breeze. Thank you!
I've just upgraded to v0.29.0, but when I try to build a project that uses ESM modules (type: "module" and .js extensions) I get this error:
TypeError: Cannot read property 'toString' of undefined
at finalizeHandler (/project/node_modules/.pnpm/@vercel+ncc@0.29.0/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:37:1866714)
Looking at ./src/index.js it seems the issue is related to calling pjsonPath.source.toString().
When I log pgjsonPath I just get the string package.json.
const pjsonPath = (baseDir === '.' ? '' : baseDir) + 'package.json';
if (assets[pjsonPath])
assets[pjsonPath].source = JSON.stringify(Object.assign(JSON.parse(pjsonPath.source.toString()), { type: 'module' }));https://github.com/vercel/ncc/blob/main/src/index.js#L532-L537
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working