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

Tries to import from unavailable chunk #618

Closed
bitflower opened this issue Mar 13, 2018 · 6 comments
Closed

Tries to import from unavailable chunk #618

bitflower opened this issue Mar 13, 2018 · 6 comments
Assignees
Labels
Awaiting Reply This PR or Issue needs a reply from the original reporter.

Comments

@bitflower
Copy link
Contributor

bitflower commented Mar 13, 2018

Stencil version:

    "@stencil/core": "^0.7.0-3",
    "@stencil/redux": "0.0.4",
    "@stencil/router": "0.0.27",
    "redux": "3.7.2",
    "redux-thunk": "2.2.0"

I'm submitting a:

[ x ] bug report

Current behavior:
There's a reference to a non existing chunk file in the component file which causes is not defined errors when (lazy) loading the component:

bildschirmfoto 2018-03-13 um 17 51 20

The error:

app-header.js:73 ReferenceError: EventEmitter is not defined
    at co-data-service-table.js:2606
    at createCommonjsModule (build/app/chunk9.js:1018)
    at co-data-service-table.js:2605 "http://localhost:3333/build/app/co-data-service-table.js"
then.catch.err @ build/app/app.core.js:2013
Promise.catch (async)
loadBundle @ build/app/app.core.js:2013
plt.queue.add @ build/app/app.core.js:1700
doHighPriority @ build/app/app.core.js:1407
Promise.then (async)
add @ build/app/app.core.js:1448
connectedCallback @ build/app/app.core.js:1695
HostElementConstructor.connectedCallback @ build/app/app.core.js:1795
$insertBefore @ build/app/app.core.js:315
updateChildren @ build/app/app.core.js:1228
patchVNode @ build/app/app.core.js:1269
patch @ build/app/app.core.js:1317
render @ build/app/app.core.js:732
renderUpdate @ build/app/app.core.js:816
update @ build/app/app.core.js:810
plt.queue.add @ build/app/app.core.js:760
doWork @ build/app/app.core.js:1416
requestAnimationFrame (async)
add @ build/app/app.core.js:1457
queueUpdate @ build/app/app.core.js:758
setValue @ build/app/app.core.js:942
setComponentProp @ build/app/app.core.js:845
unsubscribe.activeRouter.subscribe @ build/app/app-load.js:892
dispatch @ build/app/app.core.js:37
set @ build/app/app.core.js:22
history.listen @ build/app/app-load.js:880
listener @ build/app/app-load.js:347
listeners.forEach.listener @ build/app/app-load.js:357
notifyListeners @ build/app/app-load.js:357
setState @ build/app/app-load.js:444
transitionManager.confirmTransitionTo @ build/app/app-load.js:520
confirmTransitionTo @ build/app/app-load.js:339
push @ build/app/app-load.js:504
(anonymous) @ build/app/app-main.js:2361
(anonymous) @ build/app/app-main.js:50
(anonymous) @ build/app/app-main.js:1706
dispatch
(anonymous) @ build/app/chunk5.js:31
(anonymous) @ build/app/chunk5.js:9
__awaiter @ build/app/chunk5.js:5
(anonymous) @ build/app/chunk5.js:30
args @ build/app/app.core.js:126
elementClickHandler @ app-header.js:73
ev @ build/app/app.core.js:1488

It started to occur when I imported the same module the second time in another component. As long as I only use the module in one component all is working fine.

Expected behavior:
A "shared" module can be used in multiple components without errors.

Steps to reproduce:
That's the thing. The setup of the project is quite overwhelming (including backend dependency without which the code will not work). I would agree to grant access to the private repo though as I'm very much interested in
a) solving this for me and
b) stick with (super-duper) Stencil and
c) it is related to a very profilic npm module (FeathersJS)

@jgw96
Copy link
Contributor

jgw96 commented Mar 14, 2018

@bitflower So the repro case here is to import a module into two separate components correct?

@jgw96 jgw96 added the Awaiting Reply This PR or Issue needs a reply from the original reporter. label Mar 14, 2018
@bitflower
Copy link
Contributor Author

Hey, exactly, but maybe it depends on the imported module (in this case Feathers). But as a start it would be the same mod imported into 2 components, yes. Sorry didn't prepare this. Will you? Lemme know if we should chat on Slack...

@bitflower
Copy link
Contributor Author

As you can see in the pic Stencil is trying to import from chunk9 which is obviously not loaded on the left side (?)

@bitflower
Copy link
Contributor Author

bitflower commented Mar 15, 2018

I have prepared a private repo showcasing the issue. Who should I add as collaborator? You, @jgw96 or someone else?

EDIT:

I have added you for now.

The branch is "data_component" located here:
https://github.com/bitflower/caseos-ui/tree/data_component

@bitflower
Copy link
Contributor Author

This seems to work in 0.7.2! Is this on purpose or random? Thanks for your continuous updates!

@jthoms1
Copy link
Contributor

jthoms1 commented Mar 20, 2018

Great! We recently updated the version of Rollup so most likely it was fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Reply This PR or Issue needs a reply from the original reporter.
Projects
None yet
Development

No branches or pull requests

3 participants