Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤔 [ISSUE] - @eazychart-[core]- require() of ES Module #16

Open
yassinedorbozgithub opened this issue Sep 23, 2022 · 0 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest

Comments

@yassinedorbozgithub
Copy link
Collaborator

yassinedorbozgithub commented Sep 23, 2022

Description

I get an issue when i run the node index.js file with this code
const linearScale = new ScaleLinear([0,1,2,4,5,6],[0, 800]);

Reproduction steps

mkdir src
cd src
touch index.js

import { ScaleLinear } from "eazychart-core";
const linearScale = new ScaleLinear([0,1,2,4,5,6],[0, 800]);

node src/index.js

Screenshots

https://user-images.githubusercontent.com/95612053/192030171-52e6d2cc-c459-4fda-bf6e-543f0aa41baf.png

Logs

/home/yassinedorboz/Bureau/hexastack/eazychart/node_modules/eazychart-core/dist/eazychart-core.cjs.development.js:5
var d3Scale = require('d3-scale');
              ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/yassinedorboz/Bureau/hexastack/eazychart/node_modules/d3-scale/src/index.js from /home/yassinedorboz/Bureau/hexastack/eazychart/node_modules/eazychart-core/dist/eazychart-core.cjs.development.js not supported.
Instead change the require of index.js in /home/yassinedorboz/Bureau/hexastack/eazychart/node_modules/eazychart-core/dist/eazychart-core.cjs.development.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/yassinedorboz/Bureau/hexastack/eazychart/node_modules/eazychart-core/dist/eazychart-core.cjs.development.js:5:15)
    at Object.<anonymous> (/home/yassinedorboz/Bureau/hexastack/eazychart/node_modules/eazychart-core/dist/index.js:7:20)
    at async Promise.all (index 0) {
  code: 'ERR_REQUIRE_ESM'
}

Browsers

No response

OS

Linux

@yassinedorbozgithub yassinedorbozgithub added the bug Something isn't working label Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants