bazookatooth

PixiPlugin error when used with Angular

Recommended Posts

SyntaxError: import declarations may only appear at top level of a module

 

If you take a peek inside the scripts.js that angular compiles it is complaining about this

import { _gsScope } from "./TweenLite.js";

 

My Angular scripts array:

"scripts": [
"node_modules/gsap/pixiplugin.js",
"node_modules/pixi.js/dist/pixi.min.js"
]

Share this post


Link to post
Share on other sites

In case it helps anyone, this is the final scripts array I ended with that actually worked.

 

"scripts": [
"node_modules/gsap/src/minified/tweenlite.min.js",
"node_modules/gsap/src/minified/plugins/pixiplugin.min.js",
"node_modules/pixi.js/dist/pixi.min.js"
]
  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, bazookatooth said:

SyntaxError: import declarations may only appear at top level of a module

 

That error happens because the file you had listed was an ES module, which has to be imported. The scripts array expects files that don't have to be imported, i.e. the umd version.

  • Like 2

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.