Greenstand / treetracker-wallet-app

The Greenstand Wallet App
https://wallet.treetracker.org
14 stars 43 forks source link

`npm run cyu` doesn't work #169

Closed dadiorchen closed 2 years ago

dadiorchen commented 3 years ago

can not start, threw error:

[@cypress/webpack-dev-server]: removing HtmlWebpackPlugin from configuration.
Invalid configuration object. Webpack has been initialized using a configuration o
bject that does not match the API schema.
 - configuration.node should be one of these:
   false | object { __dirname?, __filename?, global? }
   -> Include polyfills or mocks for various node stuff.
   Details:
    * configuration.node has an unknown property 'module'. These properties are va
lid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'dgram'. These properties are val
id:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'dns'. These properties are valid
:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'fs'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'http2'. These properties are val
id:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'net'. These properties are valid
:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'tls'. These properties are valid
:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'child_process'. These properties
 are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
 - configuration.optimization.splitChunks should be one of these:
   false | object { automaticNameDelimiter?, cacheGroups?, chunks?, defaultSizeTyp
es?, enforceSizeThreshold?, fallbackCacheGroup?, filename?, hidePathInfo?, maxAsyn
cRequests?, maxAsyncSize?, maxInitialRequests?, maxInitialSize?, maxSize?, minChun
ks?, minRemainingSize?, minSize?, minSizeReduction?, name?, usedExports? }
   -> Optimize duplication and caching by splitting chunks by shared modules and c
ache group.
   Details:
    * configuration.optimization.splitChunks.name should be one of these:
      false | string | function
      -> Give chunks created a name (chunks with equal name are merged).
      Details:
       * configuration.optimization.splitChunks.name should be false.
       * configuration.optimization.splitChunks.name should be a string.
       * configuration.optimization.splitChunks.name should be an instance of func
tion.
 - configuration.output has an unknown property 'jsonpFunction'. These properties
are valid:
   object { assetModuleFilename?, asyncChunks?, auxiliaryComment?, charset?, chunk
Filename?, chunkFormat?, chunkLoadTimeout?, chunkLoading?, chunkLoadingGlobal?, cl
ean?, compareBeforeEmit?, crossOriginLoading?, devtoolFallbackModuleFilenameTempla
te?, devtoolModuleFilenameTemplate?, devtoolNamespace?, enabledChunkLoadingTypes?,
 enabledLibraryTypes?, enabledWasmLoadingTypes?, environment?, filename?, globalOb
ject?, hashDigest?, hashDigestLength?, hashFunction?, hashSalt?, hotUpdateChunkFil
ename?, hotUpdateGlobal?, hotUpdateMainFilename?, iife?, importFunctionName?, impo
rtMetaName?, library?, libraryExport?, libraryTarget?, module?, path?, pathinfo?,
publicPath?, scriptType?, sourceMapFilename?, sourcePrefix?, strictModuleErrorHand
ling?, strictModuleExceptionHandling?, trustedTypes?, umdNamedDefine?, uniqueName?
, wasmLoading?, webassemblyModuleFilename?, workerChunkLoading?, workerWasmLoading
? }
   -> Options affecting the output of the compilation. `output` options tell webpa
ck how to write the compiled files to disk.
   Did you mean output.chunkLoadingGlobal (BREAKING CHANGE since webpack 5)?
ValidationError: Invalid configuration object. Webpack has been initialized using
a configuration object that does not match the API schema.
 - configuration.node should be one of these:
   false | object { __dirname?, __filename?, global? }
   -> Include polyfills or mocks for various node stuff.
   Details:
    * configuration.node has an unknown property 'module'. These properties are va
lid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'dgram'. These properties are val
id:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'dns'. These properties are valid
:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'fs'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'http2'. These properties are val
id:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'net'. These properties are valid
:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'tls'. These properties are valid
:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'child_process'. These properties
 are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
 - configuration.optimization.splitChunks should be one of these:
   false | object { automaticNameDelimiter?, cacheGroups?, chunks?, defaultSizeTyp
es?, enforceSizeThreshold?, fallbackCacheGroup?, filename?, hidePathInfo?, maxAsyn
cRequests?, maxAsyncSize?, maxInitialRequests?, maxInitialSize?, maxSize?, minChun
ks?, minRemainingSize?, minSize?, minSizeReduction?, name?, usedExports? }
   -> Optimize duplication and caching by splitting chunks by shared modules and c
ache group.
   Details:
    * configuration.optimization.splitChunks.name should be one of these:
      false | string | function
      -> Give chunks created a name (chunks with equal name are merged).
      Details:
       * configuration.optimization.splitChunks.name should be false.
       * configuration.optimization.splitChunks.name should be a string.
       * configuration.optimization.splitChunks.name should be an instance of func
tion.
 - configuration.output has an unknown property 'jsonpFunction'. These properties
are valid:
   object { assetModuleFilename?, asyncChunks?, auxiliaryComment?, charset?, chunk
Filename?, chunkFormat?, chunkLoadTimeout?, chunkLoading?, chunkLoadingGlobal?, cl
ean?, compareBeforeEmit?, crossOriginLoading?, devtoolFallbackModuleFilenameTempla
te?, devtoolModuleFilenameTemplate?, devtoolNamespace?, enabledChunkLoadingTypes?,
 enabledLibraryTypes?, enabledWasmLoadingTypes?, environment?, filename?, globalOb
ject?, hashDigest?, hashDigestLength?, hashFunction?, hashSalt?, hotUpdateChunkFil
ename?, hotUpdateGlobal?, hotUpdateMainFilename?, iife?, importFunctionName?, impo
rtMetaName?, library?, libraryExport?, libraryTarget?, module?, path?, pathinfo?,
publicPath?, scriptType?, sourceMapFilename?, sourcePrefix?, strictModuleErrorHand
ling?, strictModuleExceptionHandling?, trustedTypes?, umdNamedDefine?, uniqueName?
, wasmLoading?, webassemblyModuleFilename?, workerChunkLoading?, workerWasmLoading
? }
   -> Options affecting the output of the compilation. `output` options tell webpa
ck how to write the compiled files to disk.
   Did you mean output.chunkLoadingGlobal (BREAKING CHANGE since webpack 5)?
    at validate (/Users/deanchen/work/greenstand/treetracker-wallet-web/node_modul
es/webpack/node_modules/schema-utils/dist/validate.js:105:11)
    at validateSchema (/Users/deanchen/work/greenstand/treetracker-wallet-web/node
_modules/webpack/lib/validateSchema.js:78:2)
    at create (/Users/deanchen/work/greenstand/treetracker-wallet-web/node_modules
/webpack/lib/webpack.js:108:24)
    at webpack (/Users/deanchen/work/greenstand/treetracker-wallet-web/node_module
s/webpack/lib/webpack.js:150:32)
    at Object.f [as default] (/Users/deanchen/work/greenstand/treetracker-wallet-w
eb/node_modules/webpack/lib/index.js:55:16)
    at Object.<anonymous> (/Users/deanchen/work/greenstand/treetracker-wallet-web/
node_modules/@cypress/webpack-dev-server/dist/startServer.js:44:43)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/deanchen/work/greenstand/treetracker-wallet-web/node_modu
les/@cypress/webpack-dev-server/dist/startServer.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
treetracker-wallet-web>

Some hints:

VWRoli commented 2 years ago

Working on this one

VWRoli commented 2 years ago

I'm completely stuck with this. I tried every possible solution I could come up with.

My findings: If we remove the react-scripts line from the code and create a dev server start event the component tester will run but does not recognize JSX as we removed it. I tried adding packages, removing packages, adding webpack.config file but nothing seems to be working. I don't have any more ideas so any suggestions, ideas are welcome. Or take a crack at it yourself.

React-script: https://github.com/Greenstand/treetracker-wallet-web/blob/430031b89961ca5ba2d4b61d505d575360019374/cypress/plugins/index.js#L7

Start dev server event: on('dev-server:start', () => startDevServer())

dadiorchen commented 2 years ago

I will join the analysis later on this, but first, I need to figure out how to npm start I can not event run it but I guess that's some Chinese-special problem. ;)

@QuaidBartolomei with a quick peek, do you have any idea?

VWRoli commented 2 years ago

Seems like I will be able to fix this issue after #192 will be merged.

VWRoli commented 2 years ago

This is still not working, I have a working solution which I'll implement tomorrow. @Siddhant-K-code @dadiorchen