Comments (10)
Here you go: https://github.com/tricki/stencil-helmet-prerender-bug
A simple app starter with Helmet. I've also prepared the minifyJs: false
"fix" in stencil.config.ts
(commented out).
Note: There still seems to be a bug when prerendering (errors of missing files in console) so make sure to manually empty the www
folder before each build.
from stencil-helmet.
I'll circle back soon!
from stencil-helmet.
Seems like it has something to do with minification. If I add minifyJs: false
to stencil.config.ts
the tags update correctly.
I've tracked it down to this line:
const isValidNode = (node: ChildNode) => validTagNames.indexOf(node.vtag as string) > -1;
.vtag
seems to get minified incorrectly, see this screenshot:
I'm inspecting the children
parameter (minified as a
) of the Helmet
functional component (minified as j
), the tag name is in a[0].v
but the minified isValidNode
function (minified as B
at the top) checks the t.u
property which doesn't exist in the ChildNode.
Is this perhaps an issue with Stencil (specifically its minification) and not Helmet?
from stencil-helmet.
Hey folks, can you do me a huge favor? Help me by setting up a reproduction repo that I can use. I'd love to figure out how to fix this for yall but I need a quick way to recreate and hopefully fix quickly.
from stencil-helmet.
Made a little progress on this today FYI. Not as much as I wanted but I need to step back for the moment.
from stencil-helmet.
I'd love to help but I have no idea where to start. It seems to be a problem during minification but I can't figure out why it should happen here specifically. I've tried some work-arounds but no success yet.
from stencil-helmet.
FYI I just had the same problem in my own code when trying to access the properties of a VNode in a project that doesn't have @stencil/helmet
installed, so it seems to be a problem with Stencil itself.
I created a separate issue in the main repo: ionic-team/stencil#3089
from stencil-helmet.
I just realized there's a prerelease version (0.3.3-0) which seems to fix this bug.
Here's the merged pull request switching from VNode
to ChildNode
: #10
So I'd say this issue can be closed as soon as 0.3.3 is released.
from stencil-helmet.
I just tested this again now that 0.3.3 and the issue seems to be resolved and the tags seem to update correctly.
I've updated my repro repo: https://github.com/tricki/stencil-helmet-prerender-bug/
from stencil-helmet.
I'm assuming from the above that this is now fixed since 188c0ea and we're able to close?
from stencil-helmet.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stencil-helmet.