Skip to content

TypeError: assert is not a function #23

Description

@miohtama

I have been using assert-ts fine with different environments. However, now when running with Node v16.14.2 in SvelteKit with its Node.Js adapter for Trading Strategy frontend I am getting the following error:

import assert from 'assert-ts';

console.log("Assert is", assert);
assert(input, 'input number missing');
TypeError: assert is not a function

The assert object looks good based on console.log output:

Assert is {
  configureAssert: [Getter],
  testResetConfiguration: [Getter],
  assert: [Getter],
  default: [Function: hardAssert] { soft: [Function: softAssert] }
}

This happens only when running SvelteKit application using Node.js production build adapter, not when running it with Vite development server.

Will keep debugging. All tips welcome.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions