Skip to content

Bug report: Unexpected identifier after build #72

@ichhabkeinbock

Description

@ichhabkeinbock

Describe the bug
When building the image from the original Dockerfile, I experience the issue from Issue #56 which is closed and has been fixed apparently. Tried the fix that was proposed there, which leads to a successful build, but when running the container, I stumble across another error. Trying to increase the docker node:alpine version to 23.1.0 didn't work for the same reason.

> cyberchef-server@1.0.0-beta prod
> NODE_ENV=production node index.mjs

file:///CyberChef-server/node_modules/cyberchef/src/node/api.mjs:13
import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"};
                                                                  ^^^^^^

SyntaxError: Unexpected identifier 'assert'
    at compileSourceTextModule (node:internal/modules/esm/utils:338:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:103:18)
    at #translate (node:internal/modules/esm/loader:433:12)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:480:27)

Node.js v23.1.0

To Reproduce

  • clone the repository
  • cd into the repository
  • docker build -t cyberchef-server .
  • docker run -it --rm --name=cyberchef-server -p 3000:3000 cyberchef-server
    => Fails
  • update first line in Dockerfile to FROM node:23.1.0-alpine
  • build and run, same error.

Expected behavior
After a build it should be possible to run the server without issues.

Node version:

  • 18.20.4
  • 23.1.0

Additional context
Image will be tagged for ACR and then deployed using a Container Instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions