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

ESM compatibility #10

Open
jrr opened this issue Mar 19, 2023 · 1 comment
Open

ESM compatibility #10

jrr opened this issue Mar 19, 2023 · 1 comment

Comments

@jrr
Copy link

jrr commented Mar 19, 2023

When I attempted to upgrade my project to Ink 4 / ESM, I got the following error related to ink-use-stdout-dimensions:

/Users/jrr/repos/inkle/node_modules/ink-use-stdout-dimensions/build/index.js:3
const ink_1 = require("ink");
              ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/jrr/repos/inkle/node_modules/ink/build/index.js from /Users/jrr/repos/inkle/node_modules/ink-use-stdout-dimensions/build/index.js not supported.
Instead change the require of /Users/jrr/repos/inkle/node_modules/ink/build/index.js in /Users/jrr/repos/inkle/node_modules/ink-use-stdout-dimensions/build/index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/jrr/repos/inkle/node_modules/ink-use-stdout-dimensions/build/index.js:3:15) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v18.15.0

I don't pretend to understand ESM, but I suspect ink-use-stdout-dimensions will need some changes to remain compatible with Ink 4.

For what it's worth, here's my tsconfig:

{
  "compilerOptions": {
    "target": "ES2020",
    "strict": true,
    "noEmitOnError": true,
    "forceConsistentCasingInFileNames": true,
    "skipLibCheck": true,
    "module": "node16",
    "moduleResolution": "nodenext",
    "jsx": "react",
    "esModuleInterop": true,
    "outDir": "dist"
  },
  "include": ["src"]
}
@airone01
Copy link

airone01 commented Sep 8, 2023

When I attempted to upgrade my project to Ink 4 / ESM, I got the following error related to ink-use-stdout-dimensions:

Check out this comment. You can implement dynamic resizing without any dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants