compsoul.dev Posted March 11, 2019 Share Posted March 11, 2019 import Carousel from "./modules/carousel"; (function() { console.log(new Carousel("body")); })(); I have this code in theme.js and in modules folder this one: export default class Carousel { Class stuff... } Why this code dosnt work? Errors: FF: SyntaxError: import declarations may only appear at top level of a module Chrom: Uncaught SyntaxError: Unexpected identifier Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now