Closed olokobayusuf closed 8 months ago
i fixed this in the npm package magic-admin-esm by writing "type":"module" in the package.json and making sure that things were linked properly with the .js extension (also by linking to .index instead of directories).
Like this export { MagicAdminSDK as Magic } from './core/sdk'; -> export { MagicAdminSDK as Magic } from './core/sdk.js';
I have no clue how this still hasn't been resolved, this needs to be fixed ASAP, this just bricked the log in functionality of my production site…
Thanks a lot @98mux for your solution, saved my ass :D
friendly bump, didn't this company raise $27 mil recently, where is it going? 😅
@FYJen
friendly bump, didn't this company raise $27 mil recently, where is it going? sweat_smile
@FYJen
Lmao yeah, I've recently considering moving to MojoAuth instead (havent used it yet so can't say it is better, but atleast it is way cheaper)
Thank you for bringing this to our attention, we'll get this resolved.
The priority level of this issue has been mitigated with several workarounds such as the one proposed above, using an earlier version or requiring the file. We will keep this on our radar and provide a resolution.
@ayv8er Wait a second, so instead of Magic Labs fixing this, I'm gonna have to rely on a fork made by @98mux because you don't have the time to change a couple of imports to fix a breaking problem for modern frameworks (eg. SvelteKit)?
Putting the burden of fixing bugs & maintaining fixed versions of YOUR PACKAGES on the open-source community, even after raising $27 million? That's crazy :D
@skoshx hahaha yeah this is actually wild, they cant bother to fix a game breaking bug that takes 3 minutes to fix lmao. Ive switched to mojoauth, was a relative easy switch, atleast when i dont need the web3 stuff. It would probably take them less time to fix this than the time they have probably spent discussing this issue
@98mux Yeah, seems like they're working more at the speed of an antiquated software company like SAP, rather than the speed of a startup :/ Good that you found a better alternative though, MojoAuth definitely looks good! Unfortunately, I need the web3 stuff, and MojoAuth hasn't released it yet…
@ayv8er Please re-open. Even if it's low priority because there are workarounds, it's should still be an open issue to make it easier to find and to make it clear that it hasn't been fixed in 1.4.1.
Also @98mux 's package doesn't seem to work for me (using svelte-kit with adapter-node). It has a runtime error: can't dynamically require 'crypto'. The fork doesn't have issues enabled and I doubt magiclabs would want issues raised here for someone's fork, so there's not really a good place to discuss it...
@ayv8er you guys ever going to fix this? We're currently using a fork of the magic-admin-js because of this issue.
This was a problem for me and I did what OP did to package.json
in @magic-sdk/admin
.
I am using Sveltekit and it appears to be working fine in development.
This is a breaking issue for us at Coordinape. The fork above is super out of date. Please re-open and advise.
Hi @olokobayusuf , cc @98mux @skoshx @olivercoad @pkayfire @FireMakeThunder @CryptoGraffe
We have released an update to the Admin SDK that resolves this issue. The fix is in version 2.1.0
.
Please give it a try at your earliest convenience! 🙏
@am-hernandez we're moving over to Clerk.
I believe this is still an issue in the latest version of the package: 2.4.1
. Locking down the version to 2.1.0
does work.
✅ Prerequisites
@magic-sdk/admin
)?🐛 Description
The title's pretty self-explanatory:
🧩 Steps to Reproduce
mkdir repro && cd repro
npm init -y
npm install @magic-sdk/admin
echo "import { Magic } from '@magic-sdk/admin'" > index.js
"type": "module"
topackage.json
node index.js
.🤔 Expected behavior
There shouldn't be an import error.
😮 Actual behavior
You'll get the following error:
Fix
Remove the following from Magic SDK's
package.json
:💻 Code Sample
See above.
🌎 Environment
@magic-sdk/admin
npm