ncc icon indicating copy to clipboard operation
ncc copied to clipboard

Error possibily related to bundling of import.meta.url

Open stdavis opened this issue 1 year ago • 0 comments

I'm having strange path resolution issues with import.meta.url after it's built. I have created a simple project to reproduce the issue: https://github.com/stdavis/repros/tree/main/ncc-import-meta-url

It runs without errors before it is built. But after, I get the following error message:

node:internal/process/esm_loader:40
      internalBinding('errors').triggerUncaughtException(
                                ^

[Error: ENOTDIR: not a directory, open '/Users/***/Documents/working/repros/ncc-import-meta-url/dist/bf1263f1cc68120f8f8a.js/templates/template.hbs'] {
  errno: -20,
  code: 'ENOTDIR',
  syscall: 'open',
  path: '/Users/***/Documents/working/repros/ncc-import-meta-url/dist/bf1263f1cc68120f8f8a.js/templates/template.hbs'
}

Node.js v20.10.0

I believe that it has something to do with this code in conventional-changelog-angular. After it is built, dirname is a path to the built file, not the directory in which the module resides.

Any help would be greatly appreciated. Thanks!

stdavis avatar Jun 13 '24 23:06 stdavis