Closed kure- closed 6 years ago
Sorry, the code blocks just breaks
Same happens on my Windows 10 machine, Chrome 52, node 8.2.1. Exact same errors. Can you please ellaborate on how this can be fixed and if it can be fixed?
@kure- Are you using webpack?
@austinkelleher rollup it is in this case
Just an update. I have a fix for this and will be putting up a PR soon.
@austinkelleher great thank you :)
@kure- @VojtechKlos This issue is fixed in marko@4.4.25
. Thanks for the detailed report.
@austinkelleher you rock, thanks for the notice and update! Everything runs smoothly now ;)
Bug Report
When using server side rendering with Express and using <include('../path', data)/> in Windows, the compiled javascript for the template result in:
// Compiled using marko@4.4.21 - DO NOT EDIT "use strict";
var marko_template = module.exports = require("marko/src/html").t(__filename), marko_getCurrentComponent = require("marko/src/components/taglib/helpers/getCurrentComponent"), helpers_module = require("../../public/javascripts/helpers/helpers"), titleify = helpers_module.titleify, marko_forEachPropStatusVar = require("marko/src/runtime/helper-forEachPropStatusVar"), forEacPropStatusVar = marko_forEachPropStatusVar, marko_helpers = require("marko/src/runtime/html/helpers"), marko_escapeXml = marko_helpers.x, marko_escapeXmlAttr = marko_helpers.xa, marko_forEachProp = require("marko/src/runtime/helper-forEachProperty"), marko_attr = marko_helpers.a, marko_loadTag = marko_helpers.t, w_preserve_tag = marko_loadTag(require("marko/src/components\\taglib\\preserve-tag"));
`function render(input, out) { var data = input;
var __component = marko_getCurrentComponent(out);
var componentId1 = component.elId("0[]");
w_preserve_tag({ id: __componentId1, renderBody: function renderBody(out) { out.w("<div" + marko_attr("id", __componentId1) + ">");`
}, out); }`
markotemplate. = render;
marko_template.meta = { tags: [ "marko/src/components\\taglib\\preserve-tag" ] };
The important part, I think, is that the loadTag and template meta transforms with
"\\"
. The console throws an error:Error: Could not resolve 'marko/src/components aglibpreserve-tag' from E:\xampp\htdocs\project\project\views\formFields\index.marko
The include() is called within a structure: ./views/app/index.marko ./views/formFields/index.marko
The content of formFields/index.marko is: `import { titleify } from '../../public/javascripts/helpers/helpers';
Additional Info
### Your Environment * Version used: 4.4.21 * Environment name and version (e.g. Chrome 39, node.js 5.4): node v7.8.0 * Operating System and version (desktop or mobile): Windows 8.1 (desktop) * Link to your project: