WebReflection / uhtml

A micro HTML/SVG render

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with Parcel

daz4126 opened this issue · comments

commented

Just got this error when trying to build with Parcel:

🚨 Build failed.

@parcel/core: Failed to resolve 'domconstants/constants' from
'./node_modules/uhtml/esm/creator.js'

node_modules/uhtml/esm/creator.js:1:30

1 | import { COMMENT_NODE } from 'domconstants/constants';
| ^^^^^^^^^^^^^^^^^^^^^^^^
2 |
3 | import { PersistentFragment } from './persistent-fragment.js';

@parcel/resolver-default: Cannot load file './constants' from module 'domconstants'

Any idea why that might be happening?

a bug with Parcel? Rollup has zero issues with proper ESM exports, so I have not much else to say about this issue.

to clarify, domconstants declares exports in the most modern/standard way and constants is part of such exports:
https://github.com/WebReflection/domconstants/blob/master/package.json#L24-L28

if Parcel is outdated or incapable to deal with the suggested way to export modules I am afraid there's not much I can do here, hence closing this issue, but feel free to ask more or write updates around it.

commented

Thanks. It probably is a problem with parcel. I’ll try using rollup instead.