question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module not found: Error: Can't resolve 'crypto'

See original GitHub issue

Discovered https://github.com/dequelabs/axe-core/issues/2840 along with two other warnings.

Upgraded to 4.1.4 and the issue referenced in that PR went away, but two remain (one of which seems related).

Product: axe-core

Expectation: build without warnings

Actual:

Looks like two warnings.

  1. the “deoptimized styling”…
⠼ building... [Bundler][BABEL] Note: The code generator has deoptimised the styling of /Users/typeoneerror/Dev/pn/liberator/src/es-student/node_modules/axe-core/axe.js as it exceeds the max of 500KB.
Hash: eec0cc47c69329902e13
Version: webpack 4.46.0
Time: 14359ms
Built at: 2021-04-14 11:14:34 a.m.
                                          Asset      Size             Chunks                                Chunk Names
                chunk.0.a732d854abff7e58bd66.js  15.3 KiB                  0  [emitted] [immutable]
                chunk.1.24f70e32c187061fc58d.js   155 KiB                  1  [emitted] [immutable]
              chunk.app.d932eaf004e2aac392ae.js  24.9 KiB                app  [emitted] [immutable]         app
            chunk.tests.85acc3076d461359d458.js  15.8 KiB              tests  [emitted] [immutable]         tests
      chunk.vendors~app.7ce4dcca7a2007bd7515.js  7.89 MiB        vendors~app  [emitted] [immutable]  [big]  vendors~app
chunk.vendors~app~tests.14fbc8ad9aa5f6cb458f.js   479 KiB  vendors~app~tests  [emitted] [immutable]  [big]  vendors~app~tests
    chunk.vendors~tests.1c0d66d852f055fd324d.js   874 KiB      vendors~tests  [emitted] [immutable]  [big]  vendors~tests
Entrypoint app [big] = chunk.vendors~app~tests.14fbc8ad9aa5f6cb458f.js chunk.vendors~app.7ce4dcca7a2007bd7515.js chunk.app.d932eaf004e2aac392ae.js
Entrypoint tests [big] = chunk.vendors~app~tests.14fbc8ad9aa5f6cb458f.js chunk.vendors~tests.1c0d66d852f055fd324d.js chunk.tests.85acc3076d461359d458.js
[0] multi /private/var/folders/yn/_0qbzlyj0d18mfywbnvshx1c0000gn/T/broccoli-86194fuVaC5TUTpRx/cache-1203-bundler/staging/l.js /private/var/folders/yn/_0qbzlyj0d18mfywbnvshx1c0000gn/T/broccoli-86194fuVaC5TUTpRx/cache-1203-bundler/staging/app.js 40 bytes {app} [built]
[1] multi /private/var/folders/yn/_0qbzlyj0d18mfywbnvshx1c0000gn/T/broccoli-86194fuVaC5TUTpRx/cache-1203-bundler/staging/l.js /private/var/folders/yn/_0qbzlyj0d18mfywbnvshx1c0000gn/T/broccoli-86194fuVaC5TUTpRx/cache-1203-bundler/staging/tests.js 40 bytes {tests} [built]
[../../../../../../../private/var/folders/yn/_0qbzlyj0d18mfywbnvshx1c0000gn/T/broccoli-86194fuVaC5TUTpRx/cache-1203-bundler/staging/app.js] /private/var/folders/yn/_0qbzlyj0d18mfywbnvshx1c0000gn/T/broccoli-86194fuVaC5TUTpRx/cache-1203-bundler/staging/app.js 9.63 KiB {app} [built]
[../../../../../../../private/var/folders/yn/_0qbzlyj0d18mfywbnvshx1c0000gn/T/broccoli-86194fuVaC5TUTpRx/cache-1203-bundler/staging/l.js] /private/var/folders/yn/_0qbzlyj0d18mfywbnvshx1c0000gn/T/broccoli-86194fuVaC5TUTpRx/cache-1203-bundler/staging/l.js 50 bytes {app} {tests} [built]
[../../../../../../../private/var/folders/yn/_0qbzlyj0d18mfywbnvshx1c0000gn/T/broccoli-86194fuVaC5TUTpRx/cache-1203-bundler/staging/tests.js] /private/var/folders/yn/_0qbzlyj0d18mfywbnvshx1c0000gn/T/broccoli-86194fuVaC5TUTpRx/cache-1203-bundler/staging/tests.js 1.53 KiB {tests} [built]
[./node_modules/@panzoom/panzoom/dist/panzoom.es.js] 22.7 KiB {vendors~app} [built]
[./node_modules/@precision-nutrition/courier/node_modules/qs/lib/index.js] 206 bytes {vendors~app} [built]
[./node_modules/@precision-nutrition/elements/dist/collection/util/varieties.js] 228 bytes {vendors~tests} [built]
[./node_modules/@precision-nutrition/elements/dist/loader/index.js] 271 KiB {vendors~app~tests} [built]
[./node_modules/@sentry/browser/esm/index.js] 708 bytes {vendors~app} [built]
[./node_modules/@sentry/integrations/esm/ember.js] 1.94 KiB {vendors~app} [built]
[./node_modules/autolinker/dist/es2015/index.js] 533 bytes {vendors~app} [built]
[./node_modules/axe-core/axe.js] 591 KiB {vendors~tests} [built]
[./node_modules/body-scroll-lock/lib/bodyScrollLock.esm.js] 7.81 KiB {vendors~app} [built]
[./node_modules/bowser/src/bowser.js] 18.3 KiB {vendors~app} [built]
    + 2624 hidden modules

Might be a non-issue.

  1. This can’t resolve ‘crypto’ warning…
WARNING in ./node_modules/axe-core/axe.js
Module not found: Error: Can't resolve 'crypto' in '/Users/typeoneerror/Dev/pn/liberator/src/es-student/node_modules/axe-core'
 @ ./node_modules/axe-core/axe.js

I attempted setting

browser: {
  crypto: false
}

In package.json based on some related issues in other libs.

Motivation: no warnings


axe-core version: 4.1.4
via ember-a11y-testing: 4.0.2

Browser and Assistive Technology versions

For Tooling issues:
- Node version: 14.5.4
- Platform:  macOS 10.15.7

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
strakercommented, Jan 25, 2022

We have removed crypto and it should be released next week with axe-core v4.4.

1reaction
ef4commented, Apr 16, 2021

I addressed the “deoptimized styling” warning for anyone consuming axe-core (or anything else that ships a file bigger than 500kb) via ember-auto-import in https://github.com/ef4/ember-auto-import/pull/386

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Error: Can't resolve 'crypto' - Stack Overflow
I ran into a similar issue lately while trying to use another library (tiff.js) in a small project I was experimenting with.
Read more >
Module not found: Error: Can't resolve 'crypto' [Solved]
The error "Module not found: Error: Can't resolve 'crypto'" occurs because there has been a breaking change in Webpack version 5. To solve...
Read more >
Module not found: Error: Can't resolve 'crypto' #318 - GitHub
I have use CRA (create-react-app). react-scripts Version 5.0.0 Error Message: WARNING in ./node_modules/froala-editor/js/plugins.pkgd.min.js ...
Read more >
Can't resolve 'crypto' in node_modules/bson/dist react
The app is running fine but I'm having a problem when I deploy the app to Netlify. I have to configure the deploy...
Read more >
Module not found: Error: Can't resolve 'crypto' in '/Users/user ...
Stack Overflow for Teams – Start collaborating and sharing organizational knowledge.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found