chihab / dotenv-run

Seamlessly load environment variables. Supports cli, esbuild, rollup, vite, webpack, angular. ESM and Monorepos.
246 stars 17 forks source link

Not working with ng v13 #6

Closed ajuni880 closed 2 years ago

ajuni880 commented 2 years ago

Hi,

I have installed(ng add @ngx-env/builder) this dependency in an angular project with version: 13.0.0 and when I try to serve it fails. I get the next error

[error] TypeError: Cannot destructure property 'styles' of 'buildOptions.sourceMap' as it is undefined. at getBrowserConfig (/mypath/node_modules/@angular-devkit/build-angular/src/webpack/configs/browser.js:18:21) at /mypath/node_modules/@angular-devkit/build-angular/src/builders/dev-server/index.js:127:44 at /mypath/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:72:16 at generateWebpackConfig (/mypath/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:61:40) at async generateBrowserWebpackConfigFromContext (/mypath/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:123:20) at async generateI18nBrowserWebpackConfigFromContext (/mypath/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:70:20) at async setup (/mypath/node_modules/@angular-devkit/build-angular/src/builders/dev-server/index.js:124:47)

Thanks

chihab commented 2 years ago

Hi @ajuni880, thanks for reporting the issue.

chihab commented 2 years ago

It seems like ngx-build-plus has the same issue https://github.com/manfredsteyer/ngx-build-plus/issues/307

chihab commented 2 years ago

Hey @ajuni880, Could you please check again? Please update the @ngx-env/builder package to 2.0.0.

ajuni880 commented 2 years ago

@chihab it works! thanks for the quick fix