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

Errors when importing from ESM #1776

Closed
dsherret opened this issue Feb 20, 2024 · 1 comment
Closed

Errors when importing from ESM #1776

dsherret opened this issue Feb 20, 2024 · 1 comment
Assignees
Labels
bug Issue is a bug

Comments

@dsherret
Copy link

dsherret commented Feb 20, 2024

What version of fuels-ts are you using?

0.74.0

Steps to Reproduce

npm install @fuel-ts/abi-typegen
echo 'import "@fuel-ts/abi-typegen";' > main.mjs
node main.mjs

Expected Behavior

Should run.

Actual Behavior

file:///.../node_modules/@fuel-ts/abi-typegen/dist/index.mjs:864
import { compile } from "handlebars";
         ^^^^^^^
SyntaxError: Named export 'compile' not found. The requested module 'handlebars' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'handlebars';
const { compile } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

Node.js v20.11.1

Side note about the types in this package: https://arethetypeswrong.github.io/?p=%40fuel-ts%2Fabi-typegen%400.74.0

@petertonysmith94
Copy link
Contributor

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

Successfully merging a pull request may close this issue.

3 participants