PatrickJS-starter icon indicating copy to clipboard operation
PatrickJS-starter copied to clipboard

Not suitable to use `process.env.PUBLIC` on Win

Open yuki-takei opened this issue 9 years ago • 6 comments

  • I'm submitting a ... [x] bug report [ ] feature request [ ] question about the decisions made in the repository

  • Do you want to request a feature or report a bug?

    • Reporting a bug
  • What is the current behavior?

  1. Windows 10

  2. clone master that is after [e1f25d9] (commited by @patricknazar )

  3. npm start

    • My browser try to open c/Users/Public/ when exec npm start.
    • This comes from
      const PUBLIC = process.env.PUBLIC || undefined;
      
      in /config/webpack.dev.js
      • https://github.com/AngularClass/angular-starter/blob/master/config/webpack.dev.js#L24
  • What is the expected behavior?

    • Browser try to open http://${HOST}:${PORT}.
  • What is the motivation / use case for changing the behavior?

    • Windows set the environment variable PUBLIC=c:\Users\Public
    • But most of windows users don't notice process.env.PUBLIC has already been set.
    • IMO, it's better to define the different env var instead of PUBLIC
      • e.g.
      const PUBLIC = process.env.PUBLIC_DEV || undefined;
      
  • Please tell us about your environment:

    • Angular version: ~4.3.1
    • angular-starter: [e1f25d9]
    • Browser: Firefox 52.3.0 (32 bit)

yuki-takei avatar Aug 10 '17 10:08 yuki-takei

Fair point. Thoughts on this?

patricknazar avatar Aug 10 '17 14:08 patricknazar

Same, i had to add PUBLIC=d:\Projects\Public to my .env

but still the info?t= gives error cuz its looking for

http://d/Projects/Public/info?t=1502420042548

reneszabo avatar Aug 11 '17 03:08 reneszabo

+1 Also have this issue

artbelikov avatar Aug 12 '17 19:08 artbelikov

can someone make a PR for this?

PatrickJS avatar Aug 15 '17 04:08 PatrickJS

Hi. I have an issue like this. In my console show me this https://gist.github.com/diegohdez90/76d0b6a0a85e0bd796814822c8686eb8. Check out in the line 12. My application is running at http://localhost:3000

diegohdez90 avatar Aug 15 '17 16:08 diegohdez90

Same here.

ohadinho avatar Aug 15 '17 16:08 ohadinho