Skip to content

Module not found: Error: Cannot resolve module 'cldr' - in cypress tests #941

@nensidosari

Description

@nensidosari

I am trying to use one package that contains globalize in our cypress tests, but am failing to use it because of Webpack Compilation Error that shows up.

I am already using this library inside the app, I am only unable to use it within cypress tests.
The error that shows up is this when trying to use the library that contains globalize.

Error: Webpack Compilation Error ./node_modules/globalize/dist/globalize.js Module not found: Error: Can't resolve 'cldr' in '/Users/nnn/project/acceptance-tests-cypress/node_modules/globalize/dist' resolve 'cldr' in '/Users/nnn/project/acceptance-tests-cypress/node_modules/globalize/dist' Parsed request is a module using description file: /Users/nnn/project/acceptance-tests-cypress/node_modules/globalize/package.json (relative path: ./dist) Field 'browser' doesn't contain a valid alias configuration resolve as module /Users/nnn/project/acceptance-tests-cypress/node_modules/globalize/dist/node_modules doesn't exist or is not a directory /Users/nnn/project/acceptance-tests-cypress/node_modules/globalize/node_modules doesn't exist or is not a directory .....

All the files being searched exist in node_modules where they are supposed to.

From research, Globalize may not work nicely with Webpack natively, which is the bundler cypress uses. Similar issue to this previously raised #603.

I would appreciate any suggestion on how to resolve this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions