y-scope / yscope-log-viewer

A tool that can be used to view logs compressed in CLP's IR Stream format.
Apache License 2.0
9 stars 12 forks source link

Update webpack settings to exclude 'vm' polyfill; add package-lock.json to VCS. #49

Closed junhaoliao closed 1 month ago

junhaoliao commented 1 month ago

References

  1. Running npm run start with Node.js 22 gives following error in the browser when http://localhost:3010 is loaded:
    
    Compiled with problems:
    ×
    WARNING in ./node_modules/.pnpm/asn1.js@4.10.1/node_modules/asn1.js/lib/asn1/api.js 21:12-42
    Module not found: Error: Can't resolve 'vm' in 'R:\yscope-log-viewer\node_modules\.pnpm\asn1.js@4.10.1\node_modules\asn1.js\lib\asn1'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:

Description

  1. Update webpack settings to exclude 'vm' polyfill to avoid the warning from showing up.
  2. Add package-lock.json to VCS.

Validation performed

  1. Ran npm run start again and observed no such warning as described in the above "Reference" section.