lukeed / uuid

A tiny (~230B)and fast UUID (V4) generator for Node and the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues with Webpack Externals

nicolasiscoding opened this issue · comments

Hi, I am encountering issues when using Webpack externals with this library. Although this is cryptic and does not specifically name this package, when I comment out the function in webpack that is being used, (meaning its not pulling from CDN) it appears to work. Not an urgent issue as I was able to work around this but something to be aware of.

  ERROR in main.js
  main.js from Terser plugin
  Unexpected character '@' [main.js:14607,17]
      at js_error (/REDACTED/node_modules/terser/dist/bundle.min.js:554:11)
      at parse_error (/REDACTED/node_modules/terser/dist/bundle.min.js:690:9)
      at Object.next_token [as input] (/REDACTED/node_modules/terser/dist/bundle.min.js:1123:9)
      at peek (/REDACTED/node_modules/terser/dist/bundle.min.js:1258:56)
      at next (/REDACTED/node_modules/terser/dist/bundle.min.js:1263:24)
      at maybe_assign (/REDACTED/node_modules/terser/dist/bundle.min.js:3513:17)
      at expression (/REDACTED/node_modules/terser/dist/bundle.min.js:3533:24)
      at simple_statement (/REDACTED/node_modules/terser/dist/bundle.min.js:1591:55)
      at statement (/REDACTED/node_modules/terser/dist/bundle.min.js:1404:19)
      at _embed_tokens_wrapper (/REDACTED/node_modules/terser/dist/bundle.min.js:1343:26)

  CLIENT - REDACTED (webpack 5.73.0) compiled with 1 error in 41260 ms
      case '@lukeed/uuid':
      return {
        name: packageName,
        var: '@lukeed/uuid',
        version: packageVersion,
        url: `https://unpkg.com/@lukeed/uuid@${packageVersion}/`,
      };

In this Sample Repo - https://github.com/enuchi/React-Google-Apps-Script/blob/7a26c690e1ee3f9a0f30810196b8f732534d1c60/webpack.config.js#L203

Don’t use webpack. This module is configured correctly. There’s likely some configuration issue N levels deep or webpack is just doing strange behavior, which isn’t a first