Closed evoactivity closed 2 months ago
mm, i have to take a look. one issue was the transforms setting in babel config:
must be
transforms: [...templateCompatSupport(), hotAstProcessor.transform]
but there are more issues
I don't think that has fixed it.
I moved the transform to come after templateCompatSupport and updated the addon, deleted node_modules and my lock file.
Now on the application homepage, I see the component render for a brief moment then disappears with the same error as earlier.
Uncaught (in promise) Error: Expected a dynamic component definition, but received an object or function that did not have a component manager associated with it. The dynamic invocation was
<this.curried>
or{{this.curried}}
, and the incorrect definition is the value at the paththis.curried
, which was: CurriedValue
I've pushed those changes to my repro repo.
i checked it, there is a bug with embroider vite that it does not use the optmized dep sometimes. I thought I had fixed it by doing this: https://github.com/patricklx/ember-vite-hmr/blob/main/src/instance-initializers/setup-hmr-manager.ts#L7 but apparently it does not work always. if you add
import { curry } from '@glimmer/runtime';
console.log(curry);
to your app.js it starts working
ah, I get it now why it passes in local testing. im using a linked package to ember-vite-hmr and that does not get optmized, but it's deps get optimized. Which is why it works here...
Adding the curry import makes it work :)
Nice job on this btw, it's so nice to have HMR be viable in ember now!
I've updated my app blueprint to latest and bumped the embroider deps.
I've configured the babel config as in the readme.
I have components on my application.hbs file and when I update a component I see hmr replaces application.hbs instead of the component I updated, so all state is lost.
In a different route (/test) where I have wrapped my component with a parent component, when I update my component I see this error
Reproduction is here https://github.com/evoactivity/ember-vite-hmr-state-persistence