Skip to content

Cannot use import statement outside a module #856

Answered by Snoker87
Snoker87 asked this question in Q&A
Discussion options

You must be logged in to vote

Solve it by just add /** @jsxRuntime classic / in the first line of my tsx file
Now everything work fine. Thank you I didn't know anything about bundler :
( but now I know little bit 👍

/** @jsxRuntime classic */
/** @jsx h */

import { autocomplete, getAlgoliaResults } from "@algolia/autocomplete-js";
import algoliasearch from "algoliasearch";
import { h, Fragment } from "preact";

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@Snoker87
Comment options

@Haroenv
Comment options

@Snoker87
Comment options

@Haroenv
Comment options

@Snoker87
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Snoker87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants