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

broken when upgrade to angular v6 #761

Closed
goldenbearkin opened this issue Apr 30, 2018 · 16 comments
Closed

broken when upgrade to angular v6 #761

goldenbearkin opened this issue Apr 30, 2018 · 16 comments
Labels
bug Something isn't working Build Related to build issues

Comments

@goldenbearkin
Copy link

goldenbearkin commented Apr 30, 2018

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

What is the current behavior?
broken with following error message

ERROR in ./node_modules/graphql/index.mjs
2:0-49 Can't reexport the named export 'graphql' from non EcmaScript module (only default export is available)
ERROR in ./node_modules/graphql/index.mjs
2:0-49 Can't reexport the named export 'graphqlSync' from non EcmaScript module (only default export is available)
ERROR in ./node_modules/graphql/index.mjs
39:0-61:50 Can't reexport the named export 'DEFAULT_DEPRECATION_REASON' from non EcmaScript module (only default export is available)
ERROR in ./node_modules/graphql/index.mjs
39:0-61:50 Can't reexport the named export 'GraphQLBoolean' from non EcmaScript module (only default export is available)
ERROR in ./node_modules/graphql/index.mjs
39:0-61:50 Can't reexport the named export 'GraphQLDeprecatedDirective' from non EcmaScript module (only default export is available)
ERROR in ./node_modules/graphql/index.mjs
39:0-61:50 Can't reexport the named export 'GraphQLDirective' from non EcmaScript module (only default export is available)
ERROR in ./node_modules/graphql/index.mjs
39:0-61:50 Can't reexport the named export 'GraphQLEnumType' from non EcmaScript module (only default export is available)
ERROR in ./node_modules/graphql/index.mjs
39:0-61:50 Can't reexport the named export 'GraphQLFloat' from non EcmaScript module (only default export is available)
ERROR in ./node_modules/graphql/index.mjs
39:0-61:50 Can't reexport the named export 'GraphQLID' from non EcmaScript module (only default export is available)
...

Steps to reproduce:

  1. ng new test-amplify (Angular CLI: 6.0.0-rc.7)
  2. yarn add @angular/cli@next
  3. ng update @angular/cli --migrate-only --from=1.7.0
  4. ng update rxjs --force
  5. ng update @angular/core --next --force
  6. yarn add [email protected]
  7. add below to tsconfig.app.json
"compilerOptions": {
    "types" : ["node"]
}
  1. add below to tsconfig.json
"lib": [
      "es2017",
      "dom",
      "esnext.asynciterable"
    ]
  1. add below to main.ts
// ...
import Amplify from 'aws-amplify';
Amplify.configure({});
// ...
  1. ng serve

What is the expected behavior?
No error

below is package.json

{
  "name": "test-amplify",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "6.0.0-rc.6",
    "@angular/common": "6.0.0-rc.6",
    "@angular/compiler": "6.0.0-rc.6",
    "@angular/core": "6.0.0-rc.6",
    "@angular/forms": "6.0.0-rc.6",
    "@angular/http": "6.0.0-rc.6",
    "@angular/platform-browser": "6.0.0-rc.6",
    "@angular/platform-browser-dynamic": "6.0.0-rc.6",
    "@angular/router": "6.0.0-rc.6",
    "apollo-boost": "^0.1.4",
    "aws-amplify": "^0.3.3",
    "aws-amplify-angular": "^0.1.0",
    "core-js": "^2.4.1",
    "graphql": "^0.13.2",
    "graphql-tag": "^2.9.1",
    "rxjs": "6.0.0",
    "rxjs-compat": "^6.0.0-rc.0",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.5.8",
    "@angular/cli": "^6.0.0-rc.7",
    "@angular/compiler-cli": "6.0.0-rc.6",
    "@angular/language-service": "6.0.0-rc.6",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "2.7.2"
  }
}
@elorzafe elorzafe added the investigating This issue is being investigated label Apr 30, 2018
@bwlt
Copy link

bwlt commented May 4, 2018

I'm getting the same error on a webpack powered project.
I precisely don't know what happened, but I noticed that with this tip something was changing with my TypeScript compilation.
To resolve your same issue (that exact errors on browser console) I have tried this other solution and it worked.
So I think that the issue is something related on how the bundler treat that .mjs extensions

@JQE
Copy link

JQE commented May 4, 2018

I am having this same issue. I am not sure how to modify the webpack-config.js in an angular-cli project.

If anyone has any more detailed insight it would be greatly appreciated.

@jeremyputeaux
Copy link

I wanted to give amplify a try but it does not work with angular v6

@DmitryEfimenko
Copy link

+1. This needs to be fixed ASAP

@AppField
Copy link

AppField commented May 6, 2018

+1 - I got the same errors.

@manueliglesias manueliglesias added bug Something isn't working Build Related to build issues and removed investigating This issue is being investigated labels May 7, 2018
@manueliglesias
Copy link
Contributor

Hi

I was able to reproduce this and I think I have a fix. Please stay tuned.

@JQE
Copy link

JQE commented May 8, 2018

are there working instructions on how to compile from source? I have not had any luck with any documentation i have found.

@JQE
Copy link

JQE commented May 8, 2018

nevermind. I had the wrong version of yarn.

@collindutter
Copy link

When is this patch expected to make it into a release? Is there any way I can access it sooner?

@musso
Copy link

musso commented May 10, 2018

may i ask when will it be released?

@JQE
Copy link

JQE commented May 10, 2018

If release is a ways off, is there a way to get conprehensive guide to using the dev locally?

I followed the guides, but i am still having issues. No matter how i set that up i get errors, different errors different ways.

So ya, if possible, is there a comprehensive guide for getting angular setup with the github version of aws-amplify? (which i did manage to get it compiled).

@musso
Copy link

musso commented May 10, 2018

@JQE you may wanna take a look at this... Please be noted that it's in angular 5

@JQE
Copy link

JQE commented May 10, 2018

@musso thanks for the info, but that is not what i am looking for.

aws-amplify has an angular integration
aws-amplify-angular.

I have built the local versions of those official libraries using this link

That part is working mostly. However it seems to be conflicting with the rxjs libraries. Which i am unsure how to correct as of yet.

@AppField
Copy link

Any info about a new version?
I need to upgrade to angular 6 but without a new amplify version containing this fix, I can't upgrade.

@DmitryEfimenko
Copy link

I think setting graphql dependency version to exactly 0.13.0 is more of a quick hacky solution rather than a proper fix. The proper fix will be done in Angular/CLI. The issue is tracked here

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Build Related to build issues
Projects
None yet
Development

No branches or pull requests