Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Failed to load from ES module #261

Open
@vsekhar

Description

@vsekhar

Describe the bug
SyntaxError: Unexpected token 'export' when importing to a module.

To Reproduce
Steps to reproduce the behavior:

  1. Create minimal scikit.js:
import*astffrom'@tensorflow/tfjs';import*asskfrom'scikitjs';sk.setBackend(tf)
  1. Run usingnode scikit.js.
  2. Error:
(node:576418) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.(Use `node --trace-warnings ...` to show where the warning was created)/workspace/node_modules/scikitjs/dist/esm/index.js:15export { LinearRegression } from './linear_model/LinearRegression';^^^^^^SyntaxError: Unexpected token 'export'    at internalCompileFunction (node:internal/vm:128:18)    at wrapSafe (node:internal/modules/cjs/loader:1280:20)    at Module._compile (node:internal/modules/cjs/loader:1332:27)    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)    at Module.load (node:internal/modules/cjs/loader:1206:32)    at Module._load (node:internal/modules/cjs/loader:1022:12)    at cjsLoader (node:internal/modules/esm/translators:366:17)    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:315:7)    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)Node.js v20.12.2

Desktop (please complete the following information):

  • OS: Ubuntu Jammy
  • Version: Scikitjs 1.24.0

Additional context
It may be related to unspecified ESM/CJS in package.json.

See recommendations here:https://publint.dev/scikitjs@1.24.0

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp