Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Webpack compilation doesn't stop on syntactic errors in js/vue apps #1067

Open

Description

@endarova

Environment
CLI: @next
Plugin(s): nativescript-dev-webpack@next

Describe the bug
webpack compilation doesn't stop on syntactic errors in js/vue apps

To Reproduce

  1. tns create js_app --js
  2. npm i nativescript-dev-webpack@next --save-dev --save-exact
  3. node_modules/.bin/update-ns-webpack --deps --configs
  4. tns run iOS
  5. In main-view-model.js make syntactic error (add additional " somewhere)
    Result: webpack doesn't stop on error the app is deployed and crashes

Expected behavior
the build should stop on the error and app should not be deployed broken

Additional context
Not reproducible with nativescript-dev-webpack@1.2.1
It is reproducible with run android too

Activity

  1. self-assigned this
    on Oct 18, 2019
  2. Fatme commented on Oct 22, 2019

    @Fatme
    Contributor

    Currently CLI handles only Module not found errors (wrong require/import) in js/vue applications. This is due to the fact that Module not found errors are handled by webpack itself during the compilation.
    The .js files inside js/vue applications are processed using raw-loader. It doesn't analyze the code, just copies the content of the file to bundle/vendor. However, using another loader (for example, eslint-loader) will resolve this problem as it'll analyze the code according the give options (.eslint file) and will report them to the webpack. That way, CLI will stop on syntax/semantic errors in js/vue apps.

  3. removed their assignment
    on Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions