Giter Club home page Giter Club logo

Comments (5)

pmb0 avatar pmb0 commented on July 30, 2024 2

I have workarounded this problem by using .cjs as file extension and adding support for it via pnpm patch:

diff --git a/dist/contentful-typescript-codegen.js b/dist/contentful-typescript-codegen.js
index aeb08f170f0783aa9f44abc0a53999e808d5727d..0d1e439fbc070669405d1d18aac3c017bc8c69bc 100755
--- a/dist/contentful-typescript-codegen.js
+++ b/dist/contentful-typescript-codegen.js
@@ -443,6 +443,8 @@ function determineEnvironmentPath() {
     var pathWithoutExtension = path.resolve(process.cwd(), "./getContentfulEnvironment");
     if (fs.existsSync(pathWithoutExtension + ".ts")) {
         return pathWithoutExtension + ".ts";
+    } else if (fs.existsSync(pathWithoutExtension + ".cjs")){
+        return pathWithoutExtension + ".cjs";
     }
     return pathWithoutExtension + ".js";
 }

from contentful-typescript-codegen.

Jdruwe avatar Jdruwe commented on July 30, 2024

@pmb0 it seems like that doesn't work for me, did you change anything else?

from contentful-typescript-codegen.

yangavin avatar yangavin commented on July 30, 2024

@pmb0 it seems like that doesn't work for me, did you change anything else?

What worked for me was:

  1. Save the file with LF new-lines
  2. Load the environment variables with the dotenv package

Hope this helps!

from contentful-typescript-codegen.

GabeDuarteM avatar GabeDuarteM commented on July 30, 2024

I opened a PR to apply the above patch on the package, in case you want to follow it: #159

from contentful-typescript-codegen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.