bameyrick/prevent-overscrolling

initial error module not found

Closed this issue · 4 comments

wibed commented
ERROR in ./node_modules/prevent-overscrolling/dist/mjs/index.js 1:0-51
Module not found: Error: Can't resolve './scrollable-area' in './node_modules/prevent-overscrolling/dist/mjs'
Did you mean 'scrollable-area.js'?
BREAKING CHANGE: The request './scrollable-area' 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.
resolve './scrollable-area' in './node_modules/prevent-overscrolling/dist/mjs'
  using description file: ./node_modules/prevent-overscrolling/dist/mjs/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: ./node_modules/prevent-overscrolling/dist/mjs/package.json (relative path: ./scrollable-area)
      Field 'browser' doesn't contain a valid alias configuration
      ./node_modules/prevent-overscrolling/dist/mjs/scrollable-area doesn't exist

What are you using to build? I'm guessing by the error generated it's webpack?

wibed commented

@bameyrick
webpack 5.75.0

Could you try the suggested change in this StackOverflow answer and see if this helps you?

The project is built using tsc and it looks like exporting with the extensions is not supported.

wibed commented

i havent tried but sure it works. i deem this question as answered.
thank you for your time.