-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
🐛 Pug resolves component tag wrongly in Vue files #1089
Comments
I narrowed the error down, it happens if the component has a svg use inside of it that uses a Example .pane
.pane-tabs
ui-button(v-for="paneContent in paneContentList" @click="setPaneContent(paneContent)") {{paneContent}}
.pane-content
component(:is="paneContentVisible" v-if="paneContentVisible === 'ui-button'") Teststring
svg
use(xlink:href="../../svg/symbols.svg#ei-close") |
Try with latest npm version and let us know the exact command u used |
Same issue on node 9.10.0 also i use [email protected] which is the latest I have a build script that uses the parcel API, basicall i run node build/parcel.js const Bundler = require('parcel-bundler')
const path = require('path')
const chalk = require('chalk')
// Entrypoint file location
const file = {
electron: path.join(__dirname, '../src/electron/index.js'),
renderer: path.join(__dirname, '../src/renderer/index.html')
}
// Bundler options
const options = {
electron : {
outDir: './dist/electron',
outFile: 'index.js',
publicUrl: './',
watch: false,
cache: false,
minify: false,
target: 'electron',
https: false,
logLevel: 3,
sourceMaps: true
},
renderer: {
outDir: './dist/renderer',
outFile: 'index.html',
publicUrl: './',
watch: true,
cache: false,
minify: false,
target: 'electron',
logLevel: 3,
hmrPort: 0,
sourceMaps: true,
hmr: true,
hmrHostname: '',
detailedReport: false
}
}
// Initialises a bundler using the entrypoint location and options provided
const bundler = {
electron: new Bundler(file.electron, options.electron),
renderer: new Bundler(file.renderer, options.renderer)
}
async function resolveBundles () {
const resolvedBundles = {}
for (const bundleName of ['electron', 'renderer']) {
// Awaiting one bundle after another
console.log(chalk.cyan.bold('■ Bundel: ') + bundleName + '\n')
resolvedBundles[bundleName] = await bundler[bundleName].bundle()
}
}
resolveBundles() This is the precise error the cli is outputting
|
Okay so i've found the issue but i don't know how to handle it properly.
here the code from posthtml-renderer, as you can see "component" is hardcoded to be a singular tag The parsing to posthtml-renderer happens in the HTMLAsset.js on line 164 when the ast is dirty. This happens if a |
For anyone that needs a temporary fix to this.
const HTMLAsset = require('parcel-bundler/src/assets/HTMLAsset')
class FixedAsset extends HTMLAsset {
generate() {
// Prevent posthtml-renderer from beein called, and simply
// return the content as a temporary fix.
return this.contents
}
}
module.exports = FixedAsset;
const Bundler = require('parcel-bundler')
const Path = require('path')
// adjust the entry point file here
const file = Path.join(__dirname, './index.js')
const bundler = new Bundler(file, options)
// override the html asset type.
bundler.addAssetType('html', require.resolve('./parcel-htmlhotfix.js'))
bundler.bundle()
node ./parcel.js Be aware that this can create non-validated markup since the ast is not parsed through the |
Issue |
I made a pullrequest that sets |
To load dynamic components into a vue component, the component tag is used. Those tags are handled as singluar tags
<component id="componentName"/>
or closed tags<component id="componentName"></component>
If i use pug to define the template of my component, it sometimes transpiles it correctly and sometimes the tag is not closed at all e.g
<component id="componentName">
🤔 Expected Behavior
transpiles to
Sometimes the Expected Behavior and sometimes this
🌍 Your Environment
The text was updated successfully, but these errors were encountered: