You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The immediate cause of this issue is that your Webpack config should not be mapping yaml/types to yaml/types.mjs but to yaml/browser/types.js. The change in 1.8.0 that's causing this is that the Node ES module endpoint types.mjs was added, and Webpack prefers .mjs over .js where available. Hence it's matching to the file in the root, rather than under browser/, because the "browser" field in the yaml package.json only includes a "./types.js" mapping.
I added browser mappings for ./types.mjs and ./util.mjs, which should fix this. Tested it manually with Webpack, and checked the Rollup code to make sure it'll behave the same way (provided that Rollup is configured to read browser fields).
The fundamental issue here is that when importing a CJS module from an ESM context in Node 13, its __esModule field is ignored. Webpack, on the other hand, parses it fine, and presents it as an ES module with is default & named exports. And for Node, the ESM and CJS endpoints need to internally resolve to the same sources in order to avoid a dual package hazard.
Hello! I have just upgraded
yaml
from1.7.2.
to1.8.2
and found the following problem:I guess it's an issue related to how things are exported now. Something I need to change in order to upgrade?
Note that I am using Typescript
The text was updated successfully, but these errors were encountered: