Git Product home page Git Product logo

Comments (8)

fsegurai avatar fsegurai commented on July 28, 2024 3

@chihab I tested the command provided npx ng add @ngx-env/[email protected] and no manual configuration nor further actions were required. I was able to use the environment variables 👍🏼
The build architect target property in the angular.json file was automatically updated to @ngx-env/builder:application

from ngx-env.

chihab avatar chihab commented on July 28, 2024 2

In angular.json

build target

-"browser": "src/main.ts",
+"main": "src/main.ts",

serve target

-"buildTarget": "ng-app17:build:production"
+"browserTarget": "ng-app17:build:production"
-"buildTarget": "ng-app17:build:development"
+"browserTarget": "ng-app17:build:development"

image

image

Let me know if that works for you please.

Note that it will use the webpack builder which @ngx-env/builder is built on top of.
There are still issues with using the esbuild plugins, once stable and enough documented, I'll release a new v17 compatible with vite and esbuild.

from ngx-env.

meteoiker avatar meteoiker commented on July 28, 2024 1

Thank you @chihab . I was using the env pipe and migrated everything as you said and removed the dependency. Everything works.

from ngx-env.

fsegurai avatar fsegurai commented on July 28, 2024

Yeah, got same error

from ngx-env.

fsegurai avatar fsegurai commented on July 28, 2024

@chihab the workaround provided did the trick 😄
Thanks for your time and assistance. Look forward to the new version 🥇 👍🏼

from ngx-env.

chihab avatar chihab commented on July 28, 2024

Could you give npx ng add @ngx-env/[email protected] a try?

Make sure your build architect target has "builder": "@ngx-env/builder:application".

from ngx-env.

meteoiker avatar meteoiker commented on July 28, 2024

The latest available version of @ngx-env/core is 16.1.3 depending on Angular 16. I also cannot see updated code in the repository so for the moment I cannot update to angular version 17 until this package is updated. Does this code need more work for Angular 17 support or is simply a dependency update?

from ngx-env.

chihab avatar chihab commented on July 28, 2024

@ngx-env/core@16 should work with Angular 17 but its peer dep indicates ^16 so you should have a peer dep missing issue but if you force, it should work, in theory.

Now, I would suggest not to use @ngx-env/core mainly because the good practice is not put the process.env in the template nor in the component code but rather reference it in your angular environment files (or any configuration file).

https://github.com/chihab/ngx-env?tab=readme-ov-file#use-processenv-or-importmetaenv-inside-environmentts-files

from ngx-env.

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.