Search code examples
node.jsaureliasupertestbuild-error

Adding supertest to Aurelia causes error when building vendor bundle


I have a current project using aurelia.

I add the supertest library using npm.

npm install supertest --save-dev

Now add package to aurelia.json file

{ "name": "supertest", "path": "../node_modules/supertest" }

Now run aurelia build

au run

produces following error:

Tracing supertest... error /Users/xxxxxxx/node_modules/supertest.js Writing app-bundle.js...

I have tried everything I can think of to fix this. Any help would be appreciated.


Solution

  • I recommend you to use the aurelia-skeleton-navigation setup instead which uses Gulp and JSPM -> https://github.com/aurelia/skeleton-navigation. This will provide you more on control on your project.

    Aurelia CLI is still on alpha, quoting from https://github.com/aurelia/cli:

    Note: The CLI is currently in Alpha and as such may not be suitable for use on all projects yet. In particular, projects that need to make use of extensive 3rd party libraries or Aurelia plugins may not yet work or may require extensive custom configuration or workarounds. We are in the process of addressing these issues.

    Emphasis on extensive custom configuration or workarounds lol. I myself tried the CLI initially but ended up switching to Gulp and JSPM setup instead because of the tedious importing of external libraries.