mochapack icon indicating copy to clipboard operation
mochapack copied to clipboard

Using watch fail on first refresh

Open lucabecchetti opened this issue 4 years ago • 1 comments

Hi guys, I have a test with some typescript mixins, if I run test, all works!

BaseField.vue Component ✓ Is in wrapper element ✓ Has slot ✓ It contains a valid button-group ✓ It contains a valid button-group label ✓ It not contains a default required * ✓ It contains a default required * ✓ Is visible by default ✓ Can toggle visibility ✓ Is does not show any errors ✓ Is show errors when triggered

But, if I run test with --watch options, first time all works, but at the first watcher refresh I get:

TS2307: Cannot find module '!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js' or its corresponding type declarations.

For each .ts file that it tries to load!

lucabecchetti avatar Jan 21 '21 08:01 lucabecchetti

I get this also.

First time runs fine, but with warnings:

  [                         ] 0% () WEBPACK  Compiling...                                                         
                                                                                                                  
  [=========================] 99% (done) WEBPACK  Compiled with 8 warning(s)                                      
                                                                                                                  
Warning in ./node_modules/@babel/core/lib/config/files/configuration.js                                           
                                                                                                                  
  Critical dependency: require function is used in a way in which dependencies cannot be statically extracted     
                                                                                                                  
Warning in ./node_modules/@babel/core/lib/config/files/import.js                                                  
                                                                                                                  
  Critical dependency: the request of a dependency is an expression                                               
                                                                                                                  
Warning in ./node_modules/@babel/core/lib/config/files/module-types.js                                            
                                                                                                                  
  Critical dependency: the request of a dependency is an expression                                               
                                                                                                                  
Warning in ./node_modules/@babel/core/lib/config/files/plugins.js                                                 
                                                                                                                  
  Critical dependency: require function is used in a way in which dependencies cannot be statically extracted     
                                                                                                                  
Warning in ./node_modules/@babel/core/lib/config/files/plugins.js                                                 
                                                                                                                  
  Critical dependency: require function is used in a way in which dependencies cannot be statically extracted     
                                                                                                                  
Warning in ./node_modules/@babel/core/lib/config/files/plugins.js                                                 
                                                                                                                  
  Critical dependency: require function is used in a way in which dependencies cannot be statically extracted     
                                                                                                                  
Warning in ./node_modules/@babel/core/lib/config/files/plugins.js                                                 
                                                                                                                  
  Critical dependency: require function is used in a way in which dependencies cannot be statically extracted     
                                                                                                                  
Warning                                                                                                           
                                                                                                                  
  configuration                                                                                                   
  The 'mode' option has not been set, webpack will fallback to 'production' for this value.                       
  Set 'mode' option to 'development' or 'production' to enable defaults for each environment.                     
  You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/
mode/                                                                                                             

When a file is modified (i.e. the second run) the following appears.

  [                         ] 0% () WEBPACK  Compiling...

  [=========================] 99% (done) WEBPACK  Compiled with 8 warning(s)

Warning in ./node_modules/@babel/core/lib/config/files/configuration.js

  Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Warning in ./node_modules/@babel/core/lib/config/files/import.js

  Critical dependency: the request of a dependency is an expression

Warning in ./node_modules/@babel/core/lib/config/files/module-types.js

  Critical dependency: the request of a dependency is an expression

Warning in ./node_modules/@babel/core/lib/config/files/plugins.js

  Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Warning in ./node_modules/@babel/core/lib/config/files/plugins.js

  Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Warning in ./node_modules/@babel/core/lib/config/files/plugins.js

  Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Warning in ./node_modules/@babel/core/lib/config/files/plugins.js

  Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Warning 

  configuration
  The 'mode' option has not been set, webpack will fallback to 'production' for this value.
  Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
  You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/

 MOCHA  Testing...

 RUNTIME EXCEPTION  Exception occurred while loading your tests

Error: /home/user/project/babel.config.js: Error while loading config - Cannot find module '/home/user/project/babel.config.js'
    at webpackEmptyContext (/home/user/project/dist/main.js:2318:10)
    at loadCjsDefault (/home/user/project/dist/main.js:1925:42)
    at loadCjsOrMjsDefault (/home/user/project/dist/main.js:1897:16)
    at loadCjsOrMjsDefault.next (<anonymous>)
    at readConfigJS (/home/user/project/dist/main.js:1587:47)
    at readConfigJS.next (<anonymous>)
    at Function.<anonymous> (/home/user/project/dist/main.js:4268:3)
    at Generator.next (<anonymous>)
    at evaluateSync (/home/user/project/node_modules/gensync/index.js:251:28)
    at Function.sync (/home/user/project/node_modules/gensync/index.js:89:14)
    at sync (/home/user/project/dist/main.js:4311:25)
    at sync (/home/user/project/node_modules/gensync/index.js:182:19)
    at onFirstPause (/home/user/project/node_modules/gensync/index.js:210:24)
    at Generator.next (<anonymous>)
    at cachedFunction (/home/user/project/dist/main.js:292:46)
    at cachedFunction.next (<anonymous>)

  [=========================] 100% (completed)

mocha 8.4.0 webpack 5.41.1 webpack-cli 4.7.2 mochapack 2.1.4

lingo avatar Feb 10 '22 21:02 lingo