mattermost / mattermost-plugin-google-calendar

Mattermost Google Calendar Plugin
38 stars 35 forks source link

Unable to make dist #56

Open itsmichaelk opened 1 year ago

itsmichaelk commented 1 year ago

Using an macBook Air M2, when I try to 'make dist' I get the following error: npm, gcc and go on newest version

npm WARN deprecated uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm WARN deprecated remotedev-serialize@0.1.9: Package moved to @redux-devtools/serialize.
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated redux-devtools-instrument@1.10.0: Package moved to @redux-devtools/instrument.
npm WARN deprecated redux-devtools-core@0.2.1: Package moved to @redux-devtools/app.
npm WARN deprecated uuid@3.2.1: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated rudder-sdk-js@1.0.14: 1.x.x versions of the SDK are deprecated. Please upgrade to the latest (2.x.x) version
npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@3.8.3: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated @types/history@5.0.0: This is a stub types definition. history provides its own type definitions, so you do not need this installed.
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.

added 1509 packages, and audited 1510 packages in 1m

165 packages are looking for funding
  run `npm fund` for details

6 vulnerabilities (1 low, 2 moderate, 1 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
touch webapp/.npminstall
cd webapp && /opt/homebrew/bin/npm run build;

> build
> webpack --mode=production

assets by status 1.05 KiB [cached] 1 asset
./src/index.tsx 39 bytes [built] [code generated] [1 error]

ERROR in ./src/index.tsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:68:19)
    at Object.createHash (node:crypto:138:10)
    at filename (/Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:94:23)
    at /Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:120:39
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:3:103)
    at _next (/Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:194)
    at /Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:364
    at new Promise (<anonymous>)
    at /Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:97

webpack 5.75.0 compiled with 1 error in 384 ms
make: *** [webapp] Error 1
fmartingr commented 1 year ago

Can you share specific versions of node and npm so I can try to replicate in my M2 Pro machine? In my work M1 it works as expected, but npm/node versions are pinned around for some projects.

itsmichaelk commented 1 year ago

Hi @fmartingr ,

{
  npm: '10.2.1',
  node: '21.0.0',
  acorn: '8.10.0',
  ada: '2.6.10',
  ares: '1.20.1',
  base64: '0.5.0',
  brotli: '1.1.0',
  cjs_module_lexer: '1.2.2',
  cldr: '43.1',
  icu: '73.2',
  llhttp: '9.1.2',
  modules: '120',
  napi: '9',
  nghttp2: '1.57.0',
  openssl: '3.1.3',
  simdutf: '3.2.18',
  tz: '2023c',
  undici: '5.26.3',
  unicode: '15.0',
  uv: '1.46.0',
  uvwasi: '0.0.19',
  v8: '11.8.172.13-node.12',
  zlib: '1.2.12'
}

Hope that helps!

itsmichaelk commented 1 year ago

We've just tested it on a macBook Air M1 with these versions:

{
  npm: '10.2.0',
  node: '18.18.2',
  acorn: '8.10.0',
  ada: '2.6.0',
  ares: '1.19.1',
  brotli: '1.0.9',
  cldr: '43.1',
  icu: '73.2',
  llhttp: '6.0.11',
  modules: '108',
  napi: '9',
  nghttp2: '1.57.0',
  nghttp3: '0.7.0',
  ngtcp2: '0.8.1',
  openssl: '3.0.10+quic',
  simdutf: '3.2.14',
  tz: '2023c',
  undici: '5.26.3',
  unicode: '15.0',
  uv: '1.44.2',
  uvwasi: '0.0.18',
  v8: '10.2.154.26-node.26',
  zlib: '1.2.13.1-motley'
}

Doesn't work either.

fmartingr commented 1 year ago

Can confirm it works with this in M1 Max machine:

❯ npm version
{
  npm: '8.5.0',
  node: '16.14.2',
  v8: '9.4.146.24-node.20',
  ...
}

Updating to latest (18.18.2) in the same machine ends up in the same error for me:

❯ npm version
{
  npm: '9.8.1',
  node: '18.18.2',
  v8: '10.2.154.26-node.26',
  ...
}

❯ make dist
[...]
ssets by status 1.32 KiB [cached] 1 asset
./src/index.tsx 39 bytes [built] [code generated] [1 error]

ERROR in ./src/index.tsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at filename (/private/var/folders/cv/mtjj2qh95ln7sz6l3wd2r8v80000gn/T/tmp.2kzRWN2W/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:94:23)
    at /private/var/folders/cv/mtjj2qh95ln7sz6l3wd2r8v80000gn/T/tmp.2kzRWN2W/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:120:39
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/private/var/folders/cv/mtjj2qh95ln7sz6l3wd2r8v80000gn/T/tmp.2kzRWN2W/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:3:103)
    at _next (/private/var/folders/cv/mtjj2qh95ln7sz6l3wd2r8v80000gn/T/tmp.2kzRWN2W/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:194)
    at /private/var/folders/cv/mtjj2qh95ln7sz6l3wd2r8v80000gn/T/tmp.2kzRWN2W/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:364
    at new Promise (<anonymous>)
    at /private/var/folders/cv/mtjj2qh95ln7sz6l3wd2r8v80000gn/T/tmp.2kzRWN2W/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:97

webpack 5.75.0 compiled with 1 error in 480 ms
make: *** [webapp] Error 1

Potentially a dependency we need to upgrade for the latest version. In the meanwhile, try to use 16.20. You can setup different versions locally with nvm.

I will take a look at upgrading the dependencies to latest versions.

itsmichaelk commented 1 year ago

Using nvm to change my node's version to 16.x and then run 'make dist' works just fine.