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

bug: third party library throwing 'Bundling Warning UNRESOLVED_IMPORT' #4660

Closed
3 tasks done
schirrel opened this issue Aug 7, 2023 · 3 comments
Closed
3 tasks done
Assignees
Labels
ionitron: support This is a support question

Comments

@schirrel
Copy link

schirrel commented Aug 7, 2023

Prerequisites

Stencil Version

4.0.0

Current Behavior

When adding swiper to a stencil project (usage indicated by ionic docs), when used as stated in the swiper docs , swiper is not geting reconized/inject on the bundler causing error when importing import { register } from 'swiper/element/bundle';

[ WARN ] Bundling Warning UNRESOLVED_IMPORT
'swiper/element/bundle' is imported by src/components/my-component/my-component.tsx, but could not be
resolved – treating it as an external dependency

Expected Behavior

When importing import { register } from 'swiper/element/bundle'; importing being resolved and swiper being parte of bundlers

System Info

System: node 18.16.0
    Platform: darwin (22.5.0)
   CPU Model: Apple M1 (8 cpus)
    Compiler: /Users/alanschio/Projects/stecil-swiper/stenil-swiper/node_modules/@stencil/core/compiler/stencil.js
       Build: 1691405536
     Stencil: 4.0.4 🍧
  TypeScript: 5.0.4
      Rollup: 2.42.3
      Parse5: 7.1.2
      Sizzle: 2.42.3
      Terser: 5.19.2

Steps to Reproduce

  • Create a new stencil project: npm init stencil
  • add swiper npm install swiper
  • on component add swiper import:
import { register } from 'swiper/element/bundle';
register();
  • run npm run start ou build

Code Reproduction URL

Additional Information

I have tried some issues i found like: #2332 #2577 #3893 #2554
But none resolved.
Tried to use nodeResolve property config, and rollup-plugin-node-polyfills but had no success.

Captura de Tela 2023-08-07 às 12 21 29 Captura de Tela 2023-08-07 às 12 23 25 Captura de Tela 2023-08-07 às 12 21 49
@ionitron-bot ionitron-bot bot added the triage label Aug 7, 2023
@schirrel
Copy link
Author

schirrel commented Aug 7, 2023

@rwaskiewicz if you had any time, please take a look 🙏🏻

@schirrel
Copy link
Author

schirrel commented Aug 7, 2023

Is there a change of it being related to package.json exports?
The 'swiper/element/bundle' value is on package.json exports, when using directly such import 'swiper/swiper-element-bundle.js'; it works without any warn or problems

@rwaskiewicz rwaskiewicz self-assigned this Aug 8, 2023
@rwaskiewicz rwaskiewicz added the ionitron: support This is a support question label Aug 8, 2023
@ionitron-bot
Copy link

ionitron-bot bot commented Aug 8, 2023

Thanks for the issue! This issue appears to be a support request. We use this issue tracker exclusively for bug reports and feature requests. Please use our Discord server for questions about Stencil.

Thank you for using Stencil!

@ionitron-bot ionitron-bot bot closed this as completed Aug 8, 2023
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Aug 8, 2023
@ionitron-bot ionitron-bot bot removed the triage label Aug 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ionitron: support This is a support question
Projects
None yet
Development

No branches or pull requests

2 participants