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

Window is not defined for amplify @ 1.1.29 #3477

Closed
andriachmad93 opened this issue Jun 18, 2019 · 5 comments · Fixed by #3479
Closed

Window is not defined for amplify @ 1.1.29 #3477

andriachmad93 opened this issue Jun 18, 2019 · 5 comments · Fixed by #3479
Assignees
Labels
Analytics Related to analytics bug Something isn't working

Comments

@andriachmad93
Copy link

andriachmad93 commented Jun 18, 2019

I have problem for use aws-amplify. Why the amplify message show

/home/backend/Documents/node_modules/youtube-iframe/index.js:50
}(window));
^

ReferenceError: window is not defined
at Object. (/home/backend/node_modules/youtube-iframe/index.js:50:3)
at Module._compile (module.js:577:32)
at Module._extensions..js (module.js:586:10)
at Object.require.extensions.(anonymous function) [as .js]

(/home/backend/Documents/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/home/backend/node_modules/@aws-amplify/analytics/src/Providers/AmazonPersonalizeHelper/MediaAutoTrack.ts:13:1)
at Module._compile (module.js:577:32)
at Module._extensions..js (module.js:586:10)
at Object.require.extensions.(anonymous function) [as .js]

(/home/backend/Documents/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)

When I put command NPM START. Why aws-amplify installed youtube-iframe?

@pedlop
Copy link

pedlop commented Jun 18, 2019

I'm having the same issue.

@SvetlozarKalchev
Copy link

SvetlozarKalchev commented Jun 18, 2019

I am also having this issue, but only on a build machine. I am trying to narrow it down to a version of either @aws-amplify or aws-sdk, but no luck so far.

I'll report back if I succeed.

EDIT: Ok, the issue is caused by the latest @aws-amplify/analytics. Revert back to 1.2.16 for that package and the issue will be fixed. You can take a look at the available versions here: https://www.npmjs.com/package/@aws-amplify/analytics?activeTab=versions

If anyone's interested, this file - https://github.com/aws-amplify/amplify-js/blob/master/packages/analytics/src/Providers/AmazonPersonalizeHelper/MediaAutoTrack.ts - added a reference to youtube-iframe, which causes the issue here.

@sammartinez sammartinez added Analytics Related to analytics bug Something isn't working to-be-reproduced Used in order for Amplify to reproduce said issue labels Jun 18, 2019
@sammartinez sammartinez removed the to-be-reproduced Used in order for Amplify to reproduce said issue label Jun 18, 2019
@jhoffmcd
Copy link

I found that I also get this error from @aws-amplify/ui. If you are using yarn you can resolve the sub dependencies to earlier versions by adding resolutions to the package.json:

  "resolutions": {
    "@aws-amplify/analytics": "1.2.16",
    "@aws-amplify/ui": "1.0.19"
  },

@aldegoeij
Copy link

referencing tickets #3486, #3506, #3615, #3015, #876, #3477 and webpack/webpack#6522

@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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Analytics Related to analytics bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants