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.

Dont work on node because of window

See original GitHub issue

Describe the bug Dont work on node due to use of window obj

To Reproduce

import Auth from '@aws-amplify/auth'
import Amplify from '@aws-amplify/core'

Expected behavior No errors Desktop (please complete the following information): Node 10 “@aws-amplify/auth”: “^1.2.5-unstable.3”, “@aws-amplify/core”: “^1.0.14-unstable.0”

Additional context

ReferenceError: window is not defined
at Object.<anonymous> (C:\Dev\PycharmProjects\dailyidea\front\node_modules\@aws-amplify\core\lib\RNComponents\index.js:24:20)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\Dev\PycharmProjects\dailyidea\front\node_modules\@aws-amplify\core\lib\index.js:39:10)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
powerful23commented, Oct 1, 2018

@aldarund sorry about that. I submitted another one for this issue.

1reaction
mlabienieccommented, Oct 1, 2018

Just for some context here on the overall goals for amplify. Amplify is a client side library and we want to stay focused on that (client-side not server-side, browser, mobile, RN etc). Adding actual support for node/server would take a lot more than just a global polyfill for example, a fetch polyfill, localstorage/cache, cookies etc. (and more). So adding a polyfill to just fill this window global object would not give support for node and we don’t want to confuse people by implying our support for it further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve 'node' is not recognized as an internal or ...
Open the Environment Variables option in your Control Panel. · Select the variable named Path. · Restart the command prompt again and now...
Read more >
node.js - 'node' is not recognized as an internal or an external ...
In Windows, you need to set node.js folder path into system variables or user variables. 1) open Control Panel -> System and Security...
Read more >
Why does node.exe always popup a new window in Windows?
Seems it'a problem related to powershell , I tried cmd.exe with node minutes ago, it works fine. I tried other command-line program in ......
Read more >
Set up Node.js on WSL 2 - Windows - Microsoft Learn
A guide to help you get your Node.js development environment set up on Windows Subsystem for Linux (WSL).
Read more >
How to resolve the “node is not recognized as an internal or ...
Sometimes even after successful installation of Node.js, the error keeps on appearing; this is because the environment variable is not set properly.
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