WebReflection / uhtml

A micro HTML/SVG render
MIT License
916 stars 37 forks source link

Error with Parcel #100

Closed daz4126 closed 10 months ago

daz4126 commented 10 months ago

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?

WebReflection commented 10 months ago

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

WebReflection commented 10 months ago

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.

daz4126 commented 10 months ago

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