8000 fix(connect): removes default export check causing error when importing by jrdn91 · Pull Request #772 · permaweb/ao · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(connect): removes default export check causing error when importing #772

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

Closed
wants to merge 1 commit into from

Conversation

jrdn91
Copy link
Contributor
@jrdn91 jrdn91 commented Jun 5, 2024

Closes #526

simply removes the default check as it seems that even just checking for default is causing the issue. The package indeed does not have a default export so we simply treat it as only having named exports.

Trying to used named imports throws the following error on test

import { createData, ArweaveSigner } from 'warp-arbundles'
                     ^^^^^^^^^^^^^
SyntaxError: Named export 'ArweaveSigner' not found. The requested module 'warp-arbundles' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'warp-arbundles';
const { createData, ArweaveSigner } = pkg;

which is where the initial fix comes from, moving this to treating it as a generic "default" import and then destructuring from there gets us the same rough output without the explicit default export check

@jrdn91 jrdn91 requested a review from TillaTheHun0 June 5, 2024 19:08
@jrdn91 jrdn91 closed this Jun 11, 2024
@jrdn91
Copy link
Contributor Author
jrdn91 commented Jun 11, 2024

Still needs investigation into module resolution and why NextJS may be causing this issue specifically.

@jrdn91 jrdn91 deleted the fix-nextjs-default-import-issue branch June 11, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import objects from "@permaweb/aoconnect" get error in a Next.js project when using NextJS App Router
1 participant
0