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

v6.1.1 Throws during build or preview tasks when used with Svelte-Kit #229

Closed
3 tasks done
netaisllc opened this issue Oct 20, 2021 · 1 comment · Fixed by #230
Closed
3 tasks done

v6.1.1 Throws during build or preview tasks when used with Svelte-Kit #229

netaisllc opened this issue Oct 20, 2021 · 1 comment · Fixed by #230
Labels
🐛 Bug Report released This issue/pull request has been released.

Comments

@netaisllc
Copy link

✅ Prerequisites

🐛 Description

The project will not build; the build step fails with an error as shown here:
Screen Shot 2021-10-19 at 7 18 09 PM

🧩 Steps to Reproduce

  1. Clone example project from this blog: https://magic.link/posts/magic-svelte
  2. Update existing dependencies to latest.
  3. Add new dep @sveltejs/adapter-node; this is to augment the build step so the issue is easier to spot.
  4. There are two ways to repro:
    • npm run build
    • npm run preview

A repo is available to you, see below.

🤔 Expected behavior

Expected the project to build successfully. (It does by way when its deps are not updated to latest.)

😮 Actual behavior

The project task - build or preview (which I think does a sort of default build for node) - dies upon throwing.

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:196:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:183:25)
    at async Loader.import (node:internal/modules/esm/loader:178:24)
    at async start (file:///Users/kevinm/Projects/Strongcloud/sveltekit-magic/node_modules/@sveltejs/kit/dist/chunks/index7.js:276:14)

💻 Code Sample

https://github.com/netaisllc/sveltekit-magic

🌎 Environment

Software Version(s)
magic-sdk v6.1.1
Browser n/a - this is a CLI issue
yarn npm v7.20.6
Operating System macOS BigSur 11.6
@smithki
Copy link
Contributor

smithki commented Oct 20, 2021

Please check again with magic-sdk@6.1.3!

@smithki smithki added the released This issue/pull request has been released. label Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Report released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants