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

Using with "type": "module", in package.json / ES6 #32

Open
matoni109 opened this issue Aug 17, 2022 · 0 comments
Open

Using with "type": "module", in package.json / ES6 #32

matoni109 opened this issue Aug 17, 2022 · 0 comments

Comments

@matoni109
Copy link

matoni109 commented Aug 17, 2022

Hi Team,

Trying to spin this up for a nodejs app and running into issues as we have

"type": "module",

set in our package.json

[nodemon] starting `node src/server.js`
file:///Users/me/code/platform-gateway/lib/secrets.js:3
const secrets = require("gitops-secrets/no-fs");
                ^

ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/Users/me/code/platform-gateway/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
    at file:///Users/me/code/platform-gateway/lib/secrets.js:3:17

Is there an easy enough way around this ?

Chris :)

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

No branches or pull requests

1 participant