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

upgrade to v6.0.3 throws Cannot use import statement outside a module #213

Closed
3 tasks done
vasco3 opened this issue Sep 17, 2021 · 1 comment ยท Fixed by #214
Closed
3 tasks done

upgrade to v6.0.3 throws Cannot use import statement outside a module #213

vasco3 opened this issue Sep 17, 2021 · 1 comment ยท Fixed by #214
Labels
๐Ÿ’ป Browser Browser-related ๐Ÿ› Bug Report prerelease This change is available in a prerelease. released This issue/pull request has been released.

Comments

@vasco3
Copy link

vasco3 commented Sep 17, 2021

โœ… Prerequisites

  • Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • Are you running the latest SDK version?
  • Are you reporting to the correct repository (magic-sdk)?

๐Ÿ› Description

[Description of the bug.]

๐Ÿงฉ Steps to Reproduce

  1. Using next.js import the module magic-sdk into a file.
  2. run npm run build

๐Ÿค” Expected behavior

It should build without errors

๐Ÿ˜ฎ Actual behavior

throws Cannot use import statement outside a module

...nc _post(e){const r=await this.iframe;if(!r||!r.contentWindow)throw t();r.contentWindow.postMessage(e,this.endpoint)}},configureStorage:async()=>{const e=s.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return await e.defineDriver(h),await e.setDriver([s.INDEXEDDB,s.LOCALSTORAGE,l._driver]),e}});export{y as Magic};
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:979:16)
    at Module._compile (internal/modules/cjs/loader.js:1027:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.6791 (/Users/jorgec/Downloads/code/sobras/.next/server/pages/inicio.js:52:44)
    at __webpack_require__ (/Users/jorgec/Downloads/code/sobras/.next/server/webpack-runtime.js:25:42)
    at /Users/jorgec/Downloads/code/sobras/.next/server/pages/inicio.js:17:80 {
  type: 'SyntaxError'

๐Ÿ’ป Code Sample

[If possible, please provide a code repository, gist, code snippet or sample files to reproduce the issue.]

๐ŸŒŽ Environment

Software Version(s)
magic-sdk 6.0.3
Browser any
yarn npm
Operating System MacOS 11.5.2
nodjs v14.16.1
@smithki
Copy link
Contributor

smithki commented Sep 17, 2021

๐Ÿš€ Issue was released in @magic-sdk/[email protected], @magic-sdk/[email protected], @magic-sdk/[email protected], @magic-sdk/[email protected], [email protected] ๐Ÿš€

@smithki smithki added the prerelease This change is available in a prerelease. label Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๐Ÿ’ป Browser Browser-related ๐Ÿ› Bug Report prerelease This change is available in a prerelease. released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants