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

fix: @onflow/fcl-wc in vite + TS envirtonment #1831

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

btspoony
Copy link
Contributor

@btspoony btspoony commented Jan 3, 2024

to avoid error

SyntaxError: Cannot use import statement outside a module

when using @onflow/fcl-wc in vite + TS environment

```
SyntaxError: Cannot use import statement outside a module
```
@btspoony btspoony requested a review from a team as a code owner January 3, 2024 03:47
Copy link

changeset-bot bot commented Jan 3, 2024

⚠️ No Changeset found

Latest commit: 5cf3780

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@btspoony btspoony changed the title fix: add "type": "module" to package fix: @onflow/fcl-wc in vite + TS envirtonment Jan 3, 2024
@nialexsan
Copy link
Contributor

@btspoony could you please share your vite setup?
I can't reproduce it with the standard templates

@btspoony
Copy link
Contributor Author

btspoony commented Jan 8, 2024

I am using astro.build and typescript
simple vite config in astro.config.mjs

export default defineConfig({
  output: "server",
  vite: {
      assetsInclude: ["**/*.cdc"],
      ssr: {
        external: [
          "@onflow/fcl",
          "@onflow/fcl-wc",
        ],
      },
    }
}

The original version can run normally in astro dev, but it will throw an error during astro build.
After the modification, both dev mode and build can run normally.

@nialexsan nialexsan merged commit faf47a5 into onflow:master Jan 22, 2024
1 check passed
@btspoony btspoony deleted the fix-fcl-wc branch January 23, 2024 06:55
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.

2 participants