Skip to content

ModuleNotFoundError on export #38

Description

@j0no

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch abort-controller@3.0.0 for the project I'm working on.

I kept getting the rolling error when trying to export web in expo.

Failed to compile
ModuleNotFoundError: Module not found: Error: Can't resolve './dist/abort-controller' in 'node_modules/abort-controller'
Did you mean 'abort-controller.mjs'?
BREAKING CHANGE: The request './dist/abort-controller' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

Node v16.17.1

Here is the diff that solved my problem:

diff --git a/node_modules/abort-controller/polyfill.mjs b/node_modules/abort-controller/polyfill.mjs
index 0602a64..cf581af 100644
--- a/node_modules/abort-controller/polyfill.mjs
+++ b/node_modules/abort-controller/polyfill.mjs
@@ -1,5 +1,5 @@
 /*globals self, window */
-import * as ac from "./dist/abort-controller"
+import * as ac from "./dist/abort-controller.mjs"
 
 /*eslint-disable @mysticatea/prettier */
 const g =

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions