pace-running / pace3

used for "lauf gegen rechts 2023"
2 stars 1 forks source link

npm run build fails #74

Closed pvince81tw closed 1 year ago

pvince81tw commented 1 year ago

Locally:

info  - Creating an optimized production build
Failed to compile.

static/chunks/pages/admin/login.test-c4d42d790c623893.js from Terser
  x The left-hand side of an assignment expression must be a variable or a property access.
     ,----
 302 | "http://localhost:8089" = 'mockURL';
     : ^^^^^^^^^^^^^^^^^^^^^^^
     `----

Caused by:
    0: failed to parse input file
    1: error was recoverable, but proceeding would result in wrong codegen
    2: Syntax Error
Error:
  x The left-hand side of an assignment expression must be a variable or a property access.
     ,----
 302 | "http://localhost:8089" = 'mockURL';
     : ^^^^^^^^^^^^^^^^^^^^^^^
     `----

Caused by:
    0: failed to parse input file
    1: error was recoverable, but proceeding would result in wrong codegen
    2: Syntax Error

> Build failed because of webpack errors

the reason is that it's trying to compile the test files

according to the docs and some reasearch, it's not possible to exclude test files when buildling with NextJS: https://stackoverflow.com/a/72866599

so to fix the issue we need to move the tests out

pvince81tw commented 1 year ago

I have a local test where I moved the tests out and indeed the npm run build goes through

pvince81tw commented 1 year ago

PR here: https://github.com/pace-running/pace3/pull/75