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

Amplify is not a proper es6 module #2199

Closed
goatandsheep opened this issue Nov 27, 2018 · 5 comments
Closed

Amplify is not a proper es6 module #2199

goatandsheep opened this issue Nov 27, 2018 · 5 comments
Labels
investigating This issue is being investigated

Comments

@goatandsheep
Copy link

Describe the bug
Unable to use the package at all without Webpack loaders. I get The requested module '../../node_modules/@aws-amplify/core/lib/index.js' does not provide an export named 'default'

To Reproduce
Steps to reproduce the behavior:

  1. Setup PWA Starter Kit
  2. npm install --save aws-amplify
  3. import Amplify from 'aws-amplify' in my-app.js`

Expected behavior
Amplify should be an es6 module, not just fake that it is by putting Object.defineProperty(exports, "__esModule", { value: true }); at the top of the package

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 1.0.18
  • Webcomponents, Gulp, Lit-Element

Additional context
This ticket says that the package needs to have an export, which is not the case for aws-amplify

@goatandsheep
Copy link
Author

I tried doing: import * as Amplify from 'aws-amplify' and got ReferenceError: exports is not defined at index.ts:15

@manueliglesias manueliglesias added the investigating This issue is being investigated label Nov 28, 2018
@karlito-who-else
Copy link

The documentation makes little to no mention of this issue and really should be updated to reflect the limitations of the package only being available in CommonJS format until all of the tasks in #2309 are complete. This would avoid a lot of frustration and wasted time for developers who are keen to work with the package. I saw mention of configuring Webpack for bundling modules in one page of the documentation but other pages - including the README.md of this repo - are very misleading in that they read as though the developer should be able to directly import amplify-js in the browser.

@elorzafe elorzafe added investigating This issue is being investigated and removed investigating This issue is being investigated labels Mar 1, 2019
@stale
Copy link

stale bot commented Jun 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Jun 22, 2019

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

@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
investigating This issue is being investigated
Projects
None yet
Development

No branches or pull requests

4 participants