jeffling / wallaby-webpack

webpack preprocessor for wallabyjs
25 stars 8 forks source link

Webpack 2 #24

Closed gregorskii closed 7 years ago

gregorskii commented 7 years ago

This library does not support webpack 2.

Are there plans to update it?

I think this also tries to load from the projects webpack config. If the project is using webpack 2 it crashes:

Postprocessor run failure: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.entry should be one of these:
   object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string] | function
   The entry point(s) of the compilation.
   Details:
    * configuration.entry should NOT have less than 1 properties ({
        "keyword": "minProperties",
        "dataPath": ".entry",
        "schemaPath": "#/oneOf/0/minProperties",
        "params": {
          "limit": 1
        },
        "message": "should NOT have less than 1 properties",
        "schema": 1,
        "parentSchema": {
          "minProperties": 1,
          "additionalProperties": {
            "oneOf": [
              {
                "description": "The string is resolved to a module which is loaded upon startup.",
                "minLength": 1,
                "type": "string"
              },
              {
                "description": "All modules are loaded upon startup. The last one is exported.",
                "$ref": "#/definitions/common.nonEmptyArrayOfUniqueStringValues"
              }
            ]
          },
          "description": "Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.",
          "type": "object"
        },
        "data": {}
      }).
      object { <key>: non-empty string | [non-empty string] }
      Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.
    * configuration.entry should be a string.
    * configuration.entry should be an array:
      [non-empty string]
    * configuration.entry should be an instance of function
      function returning an entry object or a promise..
 - configuration.resolve has an unknown property 'fallback'. These properties are valid:
   object { alias?, aliasFields?, cachePredicate?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
 - configuration.resolve.extensions[0] should not be empty.

Thanks :)

ArtemGovorov commented 7 years ago

Wallaby-webpack fully supports webpack 2 (we have been supporting it since early beta bits of webpack 2).

I think this also tries to load from the projects webpack config

Wallaby-webpack doesn't automatically load webpack config. You have to pass the config to it (and if it is a valid webpack 2 config, it should work).

Please share a sample with the issue, happy to have a look.

gregorskii commented 7 years ago

Ok, I will double check everything. Thanks for the clarification.

I did pass the config to it in the wallaby config.

developermj commented 7 years ago

A corporate project I work on also experienced this. After lots of work I discovered that the issue was because the node_modules folder wasn't at the same level as the wallaby.js file. For the time being I have solved the issue by having a duplicate copy of our node_modules folder next to the wallaby.js file. This isn't ideal but it allows us to test.

ArtemGovorov commented 7 years ago

@developermj It should be possible to configure wallaby to work for your case. A couple of things may be required:

developermj commented 7 years ago

I'm not sure if I should continue to post here. I tried the suggested solution and they are not working for me.

Here is the setup from wallaby-webpack: var path = require("path");

var modulesPath = path.resolve("../../node_modules");

var wallabyWebpack = require('wallaby-webpack'); var webpackPostprocessor = wallabyWebpack({ resolve: { modules: [modulesPath] }, resolveLoader: { modules: [modulesPath] } });

Posting my debug log from running wallaby: wallaby.js started core v1.0.391 Mon, 22 May 2017 14:50:58 GMT wallaby:project Wallaby config: Dev\Source\\src\Common\wallaby.js Mon, 22 May 2017 14:50:59 GMT wallaby:uiService Listening port 51235 Mon, 22 May 2017 14:50:59 GMT wallaby:project File cache: C:\Users\\AppData\Local\Temp.wallaby\projects\rba5zt02YVCCfocjrkp9NOrK+qA=\cache Mon, 22 May 2017 14:50:59 GMT wallaby:project Config file change detected, invalidating local cache Wallaby App available at: http://wallabyjs.com/app/#/files Mon, 22 May 2017 14:50:59 GMT wallaby:workers Parallelism for initial run: 2, for regular run: 2 Mon, 22 May 2017 14:50:59 GMT wallaby:workers Starting run worker instance #0 Mon, 22 May 2017 14:50:59 GMT wallaby:workers Starting run worker instance #1 Mon, 22 May 2017 14:50:59 GMT wallaby:workers Web server is listening at 2287 Mon, 22 May 2017 14:50:59 GMT wallaby:project File cache requires some updates, waiting required files from IDE Mon, 22 May 2017 14:50:59 GMT wallaby:project File file1.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project File file2.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project File file3.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project File file4.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project File file5.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project File file6.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project File file7.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project File file8.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project File file9.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project File file1Spec.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project File file2Spec.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project File file3Spec.ts changes are patches only: false Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file9.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file3Spec.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file1.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file1Spec.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file2.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file3.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file4.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file5.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file6.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file7.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file8.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:00 GMT wallaby:project Preparing to process file2Spec.ts Mon, 22 May 2017 14:51:00 GMT wallaby:project Starting processor pool (if not yet started) Mon, 22 May 2017 14:51:01 GMT wallaby:workers Started run worker instance (immediate) #0 Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file9.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file9.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file9.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file9.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file9.ts changes saved, store ts: 636307377600625900, change ts: 1495464660030 Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file2.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file2.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file2.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file2.ts Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file3.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file3.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file3.ts Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file4.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file3.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file4.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file4.ts Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file5.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file4.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file5.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file5.ts Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file6.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file5.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file6.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file6.ts Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file7.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file6.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file7.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file7.ts Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file8.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file7.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file2.ts changes saved, store ts: 636308278776009600, change ts: 1495464660008 Mon, 22 May 2017 14:51:01 GMT wallaby:project File file8.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file8.ts Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file2Spec.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file8.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file3.ts changes saved, store ts: 636308278685263400, change ts: 1495464660011 Mon, 22 May 2017 14:51:01 GMT wallaby:project File file2Spec.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file2Spec.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file2Spec.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file4.ts changes saved, store ts: 636307341502711600, change ts: 1495464660014 Mon, 22 May 2017 14:51:01 GMT wallaby:project File file5.ts changes saved, store ts: 636308278799283500, change ts: 1495464660017 Mon, 22 May 2017 14:51:01 GMT wallaby:project File file2Spec.ts changes saved, store ts: 636307360201333500, change ts: 1495464660036 Mon, 22 May 2017 14:51:01 GMT wallaby:project File file6.ts changes saved, store ts: 636307416461436900, change ts: 1495464660021 Mon, 22 May 2017 14:51:01 GMT wallaby:project File file7.ts changes saved, store ts: 636308278819869600, change ts: 1495464660024 Mon, 22 May 2017 14:51:01 GMT wallaby:project File file8.ts changes saved, store ts: 636307343476281000, change ts: 1495464660027 Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file1.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file1.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file1.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file1.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file1.ts changes saved, store ts: 636307408643174500, change ts: 1495464659990 Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file3Spec.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file3Spec.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file3Spec.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file3Spec.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file3Spec.ts changes saved, store ts: 636307362975103700, change ts: 1495464660039 Mon, 22 May 2017 14:51:01 GMT wallaby:processor No compilers found for file1Spec.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file1Spec.ts is not instrumented by core Mon, 22 May 2017 14:51:01 GMT wallaby:project No preprocessors configured for file1Spec.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project Writing to disk and caching processed file file1Spec.ts Mon, 22 May 2017 14:51:01 GMT wallaby:project File file1Spec.ts changes saved, store ts: 636307238000073000, change ts: 1495464660033 Mon, 22 May 2017 14:51:01 GMT wallaby:project Stopping process pool Mon, 22 May 2017 14:51:01 GMT wallaby:project Running postprocessor Mon, 22 May 2017 14:51:01 GMT wallaby:postprocessor New TypeScript language service is required Mon, 22 May 2017 14:51:01 GMT wallaby:postprocessor TypeScript compiler options module (before tsconfig.json): undefined Mon, 22 May 2017 14:51:02 GMT wallaby:postprocessor TypeScript compiler options module (after tsconfig.json): 1 Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file9.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file1.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file2.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file3.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file4.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file5.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file6.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file7.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file8.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file1Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file2Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Preparing to process file3Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file9.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file9.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file1.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file1.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file2.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file2.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file3.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file3.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file4.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file4.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file5.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file5.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file6.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file6.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file7.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file7.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file8.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file8.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file1Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file1Spec.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file2Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file2Spec.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project Processing compiled file3Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Instrumenting file3Spec.js, via process pool: false Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file9.js Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file1.js Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file2.js Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file3.js Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file4.js Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file5.js Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file6.js Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file7.js Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file8.js Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file1Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file2Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:project No preprocessors configured for file3Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file9.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file1.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file2.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file3.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file4.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file5.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file6.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file7.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file8.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file1Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file2Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:project Writing to disk and caching processed file file3Spec.js Mon, 22 May 2017 14:51:02 GMT wallaby:workers Started run worker instance (immediate) #1 Mon, 22 May 2017 14:51:02 GMT wallaby:postprocessor New compiler created Mon, 22 May 2017 14:51:02 GMT wallaby:project WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

  • configuration.resolve.modules[1] should be a string.
  • configuration.resolveLoader.modules[1] should be a string. at WebpackPostprocessor.webpack [as _webpack] (Dev\Source\\node_modules\webpack\lib\webpack.js:19:9) at WebpackPostprocessor._createCompiler (Dev\Source\\node_modules\wallaby-webpack\index.js:270:41) at Dev\Source\\node_modules\wallaby-webpack\index.js:112:31 at C:\Users\.wallaby\core\server.js:16:17265 From previous event: at Object.postprocessor (C:\Users\.wallaby\core\server.js:16:16323) at C:\Users\.wallaby\core\server.js:16:31587 at [object Object]._onTimeout (C:\Users\.wallaby\core\server.js:16:31138) at Timer.listOnTimeout (timers.js:92:15) Mon, 22 May 2017 14:51:02 GMT wallaby:project Test run finished Mon, 22 May 2017 14:51:02 GMT wallaby:project Test run data re-queued
ArtemGovorov commented 7 years ago

@developermj Could you please create a sample repo with your setup (and folder structure) so we could have a look?