Jump to content

Cannot find module '@pixi/filter-bloom' (TypeScript)


Recommended Posts

Hello!

I want to try out some additional filters, e. g. the bloom filter. I followed the instructions on npm - @pixi/filter-bloom.

But when i add the import statement into my main.ts, i get the following error:

"Cannot find module '@pixi/filter-bloom'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"

 

This is a snippet from my main.ts:

main_ts.PNG.f19fd2b74f764b4f37c8b397bc2c1879.PNG

 

The module appears under my node_modules directory and comes with a types.d.ts:

files.PNG.1b221de98dddf9b0793872b26013cc0c.PNG       

declaration.PNG.a872ea876c134968bd8d457652585c22.PNG

 

The module is listed in my package.json file:

dependencies.PNG.e5f1538146d60449be6c8fa754385509.PNG

 

Any idea how to solve this error?

Best regards,
srcnuzn

 

Link to post
Share on other sites

I solved it!!  For anyone, running into the same problem:

You need to add the module to the types field in your tsconfig.json file:

tsconfig.PNG.aef41d10ecb0041d86b0855c203b4eca.PNG

 

In VSCode, i also get the type information now.

mouseover.PNG.aaa602ae3fe1364f1dadd4daf6552743.PNG

 

Since im new to typescript and web-dev, maybe someone could tell me if this approach is correct?
Also, maybe someone can explain what's happening in the background. 

Thanks anyways :)

-srcnuzn

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...