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

1.0.0-beta.13 missing index.es.js #245

Closed
kresli opened this issue Jan 6, 2022 · 12 comments
Closed

1.0.0-beta.13 missing index.es.js #245

kresli opened this issue Jan 6, 2022 · 12 comments

Comments

@kresli
Copy link

kresli commented Jan 6, 2022

I have trouble to use the package with ViteJS as index.es.js is missing
image

@michalochman
Copy link
Owner

Hi @kresli, right – it's missing in the files section. I'll add it and release new version.

@michalochman
Copy link
Owner

@kresli I have just released react-pixi-fiber@1.0.0-beta.14.

@cmfcmf
Copy link

cmfcmf commented Jan 7, 2022

I think you also need to add the es/ folder to files - while the index.es.js now exists, it references files in the es folder that don't exist.

@michalochman
Copy link
Owner

Nice catch @cmfcmf, whoops! 🤦‍♂️

Fixed in react-pixi-fiber@1.0.0-beta.15

@kresli
Copy link
Author

kresli commented Jan 19, 2022

That fixed it but I'm unsure if that's enough as
image
My wild guess extras particles and mesh are plugins and they are not registered.

@michalochman
Copy link
Owner

michalochman commented Jan 20, 2022

These are from PixiJS v4 and they are conditionally used. See how an instance of BitmapText is created for example.

Do you have any ideas how to fix it @kresli?

On one hand I would prefer not to break compatibility with PixiJS v4, but on the other hand it is already 2 major versions behind and removing it would simplify some areas of the codebase.

@kresli
Copy link
Author

kresli commented Jan 20, 2022

Could be those dynamically imported like import("mesh")? Just guessing here as I never did that

UPDATE: that's a bad idea as dynamic import could be detected by bundler which will end up with the same issue

@kresli
Copy link
Author

kresli commented Jan 20, 2022

do we really need to import them? As developer could install them as perDependency if necessary

@michalochman
Copy link
Owner

They are not imported per se, what is imported in source coude is: import * as PIXI from "pixi.js";.

Perhaps it is the bundler (rollup) that changes the import for the es output format. I don't know how to fix it.

@kresli
Copy link
Author

kresli commented Jan 20, 2022

For now, I'm using patch-package on removed imports.

@michalochman
Copy link
Owner

@kresli can you share more details please?

@kresli
Copy link
Author

kresli commented Feb 17, 2022

sorry for the late reply.
I'm using https://www.npmjs.com/package/patch-package and manually remove those imports from react-pixi-fiber file in node_modules.

yarn add patch-package
open node_modules/react-pixi-fiber/es/react-pixi-fiber.development.js
remove all the invalid imports which throws in build
yarn run patch-package react-pixi-fiber

I guess this need to be done for production too 🤔

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

No branches or pull requests

3 participants