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

Building Ionic for Browser -- #39

Open
aronAtWex opened this issue Apr 6, 2021 · 0 comments
Open

Building Ionic for Browser -- #39

aronAtWex opened this issue Apr 6, 2021 · 0 comments

Comments

@aronAtWex
Copy link

I hope somebody is out there that can still help with this.
Out of the blue I'm not able to build an Ionic 3 app for browser. Can build fine for local (npm server) and can build ios and Android just fine. But when building for browser

MY_ENV=no ionic cordova build browser --prod --verbose

ENV no is set up. This just tells the code that there is no URL to hit. The code and the URL live on the same server.

Getting this error.

Error: ..filePage.ts
Module not found: Error: Can't resolve '@app/env' in '/filePage'
resolve '@app/env' in '/filePage'
  Parsed request is a module
  No description file found
  resolve as module
    looking for modules in /appRoot/node_modules
      using description file: /appRoot/package.json (relative path: ./node_modules)
        Field 'browser' doesn't contain a valid alias configuration
      after using description file: /appRoot/package.json (relative path: ./node_modules)
        using description file: /appRoot/package.json (relative path: ./node_modules/@app/env)
          no extension

Some reason it can't figure out what @app/env is. Code then tries to find it in node_modules goes down the wrong path.

Most of what is set up in this git hub is being used.

tsconfig.json

"paths": {
      "@angular/*": ["../node_modules/@angular/*"],
      "@app/env": [
         "environments/environment"
      ]
    }

In the custom /config/webpack.config.js setting up the @app/env for each environment

if(env == 'dev' || env == 'no')
{
  useDefaultConfig.dev.resolve.alias = {
    "@app/env": path.resolve(envPath)
  };
}
else
{
  useDefaultConfig.prod.resolve.alias = {
    "@app/env": path.resolve(envPath)
  };
}

I suspect maybe something with this isn't working anymore. app/env is empty ? Why only browser would be effected?

I don't know how to verify this is getting set up correctly.
I don't even know what to debug to get the browser version working.

I added and removed the browser "app". No change.
I have even uninstall node_modules and set them back up again. (maybe that did more harm).

Any ideas would be appreciated.

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

No branches or pull requests

1 participant