question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build fails due to missing dependency in @aws-amplify/pubsub

See original GitHub issue

Describe the bug We’re using @aws-amplify/api-graphql, @aws-amplify/auth, @aws-amplify/core and @aws-amplify/storage in our react app. All of the todays builds in our CI/CD fails due to an unresolved dependency in the @aws-amplify/pubsub package.

To Reproduce Steps to reproduce the behavior:

  1. create a new react app
  2. add these dependencies:
    @aws-amplify/api-graphql @aws-amplify/auth @aws-amplify/core @aws-amplify/storage
  3. import API from “@aws-amplify/api-graphql” in App.js;
  4. npm start or npm run build
  5. See error Failed to compile. ./node_modules/@aws-amplify/pubsub/lib-esm/Providers/AWSAppSyncRealTimeProvider.js Module not found: Can't resolve 'isomorphic-ws' in '/node_modules/@aws-amplify/pubsub/lib-esm/Providers'

Expected behavior The app builds and/or runs

Screenshots Bildschirmfoto 2020-09-03 um 14 53 29

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ericclemmonscommented, Sep 3, 2020

This is fixed!

diff --git a/package.json b/package.json
index b5cb308..d4bb804 100644
--- a/package.json
+++ b/package.json
@@ -3,6 +3,10 @@
   "version": "0.1.0",
   "private": true,
   "dependencies": {
+    "@aws-amplify/api-graphql": "^1.2.1",
+    "@aws-amplify/auth": "^3.4.1",
+    "@aws-amplify/core": "^3.5.1",
+    "@aws-amplify/storage": "^3.3.1",
     "@testing-library/jest-dom": "^4.2.4",
     "@testing-library/react": "^9.3.2",
     "@testing-library/user-event": "^7.1.2",
diff --git a/src/App.js b/src/App.js
index ce9cbd2..2bbd2b1 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,3 +1,4 @@
+import API from '@aws-amplify/api-graphql';
 import React from 'react';
 import logo from './logo.svg';
 import './App.css';
yarn run v1.22.4
$ react-scripts build
Creating an optimized production build...
Compiled with warnings.

./src/App.js
  Line 1:8:  'API' is defined but never used  no-unused-vars

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

File sizes after gzip:

  39.38 KB  build/static/js/2.fd671573.chunk.js
  770 B     build/static/js/runtime-main.efc9bf3d.js
  644 B     build/static/js/main.5b88f605.chunk.js
  547 B     build/static/css/main.5f361e03.chunk.css
1reaction
ericclemmonscommented, Sep 3, 2020

Confirmed fixed on unstable:

diff --git a/package.json b/package.json
index b5cb308..3f9a6b9 100644
--- a/package.json
+++ b/package.json
@@ -3,6 +3,10 @@
   "version": "0.1.0",
   "private": true,
   "dependencies": {
+    "@aws-amplify/api-graphql": "^1.2.1-unstable.2",
+    "@aws-amplify/auth": "^3.4.1-unstable.2",
+    "@aws-amplify/core": "^3.5.1-unstable.2",
+    "@aws-amplify/storage": "^3.3.1-unstable.2",
     "@testing-library/jest-dom": "^4.2.4",
     "@testing-library/react": "^9.3.2",
     "@testing-library/user-event": "^7.1.2",
diff --git a/src/App.js b/src/App.js
index ce9cbd2..2bbd2b1 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,3 +1,4 @@
+import API from '@aws-amplify/api-graphql';
 import React from 'react';
 import logo from './logo.svg';
 import './App.css';
❯ yarn build
yarn run v1.22.4
$ react-scripts build
Creating an optimized production build...
Compiled with warnings.

./src/App.js
  Line 1:8:  'API' is defined but never used  no-unused-vars

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

File sizes after gzip:

  39.38 KB  build/static/js/2.fd671573.chunk.js
  770 B     build/static/js/runtime-main.efc9bf3d.js
  644 B     build/static/js/main.5b88f605.chunk.js
  547 B     build/static/css/main.5f361e03.chunk.css

We’ll get this out soon!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring build settings - AWS Amplify Hosting
Configure the build settings for an app deployed with Amplify Hosting. ... You can install OS packages for missing dependencies. build: phases: preBuild: ......
Read more >
Unable to resolve "aws-amplify" from "App.js" - Stack Overflow
I have been trying to downgrade dependencies, but that throws me down a dependency rabbit hole, where I don't want to be. Something...
Read more >
AWS Amplify and Angular - How to ? | by Anand Sharma
Install AWS amplify cli and Create a new Angular Application: · aws-amplify — The below npm package needs it, else you will get...
Read more >
@aws-amplify/api-graphql - npm package | Snyk
All security vulnerabilities belong to production dependencies of direct and indirect packages. License: Apache-2.0. Security Policy: No.
Read more >
Error Codes | Cloud Pub/Sub Documentation
Error HTTP Code Description UNAUTHENTICATED 401 The client is not authenticated properly. UNAVAILABLE 503 The service was unable to process a request.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found