Questions tagged [marko]
An HTML-based templating engine that compiles templates to Node.js-compatible JavaScript modules and supports streaming, async rendering and custom tags.
64
questions
1
vote
0
answers
36
views
Has any one gotten @marko/testing-library to work with vitetest?
I have a project in Vite, Fastify and Marko and am trying to use Vitest.
I want to test individual components/templates. Say pass in inputs (props) and test if the output (typically HTML) is as ...
0
votes
1
answer
148
views
Marko in expressjs throwing not a function error
Hi I ran this example on my machine and it says markoExpress() is not a function. Any ideas ? This is example from https://markojs.com/docs/express/
require("@marko/compiler/register"); // ...
0
votes
2
answers
126
views
<await> multiple promises in Marko
In Marko, how can one <await> multiple promises in parallel?
For example, I am looking for something like this:
<await(promise1, promise2)>
<@then|result1, result2|>
promise1 ...
0
votes
1
answer
172
views
How can I dynamically create HTML components in Marko?
I want to create new Marko components every time the user clicks a button — by calling something like the JavaScript DOM method document.createElement("tag"). How can I do this in Marko, not ...
0
votes
1
answer
213
views
Prepend a url to all relative image links in a markdown document
I have a bunch of markdown documents with a mix of relative and absolute image destinations. e.g.
This is some text
![optional caption](/sub/folder/image.png)
And more text
![](https://example.com/...
0
votes
1
answer
33
views
MarkoTag not valid
I have a java application which is serving up a react ts app on the client side. I want to integrate marko into my application in order to access some marko components.
I'm trying to follow a guide on ...
4
votes
1
answer
2k
views
Svelte vs MarkoJS
I’m working on rebuilding a new project for many reasons. Currently the project uses Marko.
I’m investigating if it’s worth moving to svelte.
I actually didn’t find a big difference between them.
Does ...
0
votes
1
answer
106
views
How to pass object to components in marko?
Hello I am trying to call a component with an object as parameter but the component prints the object as string "[object Object]".
In the docs it specify object as an attribute type: https://...
1
vote
1
answer
196
views
Rendering from strings instead of files with MarkoJS
I'm using markojs for my emails templates but now we are moving these templates inside our database to edit them online.
We still need to use marko to keep our full HTML structure and variables ...
0
votes
3
answers
165
views
HTTPS node server doesn't return web pages
So I have just turned my HTTP web application to HTTPS.
So my server.js currently looks like
const https = require('https');
const fs = require('fs');
const options = {
key: fs.readFileSync('...
2
votes
0
answers
178
views
Compile single marko component with webpack
how can I compile a single marko.js component with webpack or marko-cli, so I can use it as npm module from the npm registry?
The component is working well within my projects as an integrated ...
2
votes
1
answer
71
views
eBay skin not working on HTML web pages but successfully installed
I am currently trying to use the @ebay/skin package for UI elements in my marko project but they don't seem to be working.
My package.json file looks like this
{
"name": "marko-starter-demo",
"...
2
votes
0
answers
169
views
Vue client-side and Marko server-side (MPA)
In a multi-page web app project, the server part runs on Node.js and Express.
Marko is used as a template engine for server-side rendering. Example :
<h1>${ out.global.__('user.title') } </...
1
vote
0
answers
180
views
What is the reason of "Cannot read property 'insertInto' of undefined" error in MarkoJS component?
I usually face the above error when doing some changes to a component by listening to the window resize event. I think this happens because somehow the component will get dirty during the update and ...
2
votes
1
answer
172
views
Handlebards.js vs Marko.js: What templating library should I use for a portfolio type website? Marko.js or Handlebars.js?
Handlebards.js vs Marko.js: Link to Marko.js library
I have to develop a portfolio site for a friend. The majority of the site will be static with things like information about the person, skills, ...
0
votes
1
answer
167
views
How to pass an Event Listener as a Dynamic Attribute in Marko?
I'm trying to create a form in Marko and for the inputs I'm using a component that will create the inputs and will handle the validation.
The hole problem is when I try to pass an event listener as a ...
0
votes
1
answer
166
views
Google Cloud Functions doesn't load file directory correctly
I'm building a little function that sends mails through Google Cloud Functions.
For templating i'm using Marko.js.
When i do a require to a folder, returns a strange require with some numbers on ...
0
votes
1
answer
138
views
cannot babel transform .marko files with webpack 4
i have a working marko setup for my widget. Im using webpack 4 and babel 7. When i add babel-loader to .marko files, the webpack compiler throws because it couldn't recognize marko's syntax as valid ...
1
vote
1
answer
105
views
How can i nest marko components in the file tree
i dont know how to access components that are nested in the components folder in my app's root index component. what i expected was that i can reference them via a nested html tag
i have a very solid ...
1
vote
1
answer
259
views
Marko Dynamic Tag with Component
I have a marko website where I have some dynamic components being called via a for loop:
/pages/note/index.marko
import layout from "../../layouts/base"
<${layout} title="test">
<for|...
0
votes
1
answer
331
views
How to send an object to .marko template and render its properties dynamically, in a table
Im doing some homework here. Build a server that handles a requisition to list all registers from a database, dynamically. Im using node js and the modules: express, marko and sqlite3. The db is set ...
1
vote
1
answer
566
views
When I deploy the application Nodejs with Markojs at google cloud app engine, I receive the error "EROFS: read-only file system...'"
I'm new in Google Cloud Resources.
I'm deploying a Nodejs(with Markojs) application at google cloud's app engine and I'm getting the error "EROFS: read-only file system, open '/srv/src/app/converter/...
0
votes
1
answer
100
views
Repeatable attribute tags in markojs
I want a custom tag for tabs that will give me the possibility to write following code
app-tabset#my-tab
@tab title="first"
p -- content of first tab
@tab title="second"
p -- content of ...
0
votes
1
answer
261
views
How to use Google Maps with Marko.js and Lasso.js and link global variables to other templates
I'm in a project using Marko.js with Lasso.js for building .js and .scss code. I can successfully interact with Google Maps API through <script> tags. I wish to send latitude and longitude ...
2
votes
1
answer
324
views
Is there a way to access the "window" and "document" references in a marko class?
I am using Marko and am needing to access the window and viewport height. I need the height of a specific div, and the height of the viewport. This is typically achieved by something similar to this
...
0
votes
2
answers
2k
views
Render error. Exception: (function (exports, require, module, __filename, __dirname) { class {
when i start server with npm test the error above is shown but when i run server and test separately it works fine
detailed error message is :
Render error. Exception: /home/irisind/Akhil/myproj/...
4
votes
1
answer
680
views
How do I render raw HTML in Markojs?
I am using Markojs as my UI library and I am needing to render raw HTML that is included in the data model retrieved from the server.
For example, let's say my data model being retrieved from the ...
2
votes
1
answer
82
views
Getting errors in the MarkoJs "Getting Started" tutorial
I'm a newbie at Node.js and Marko. Getting errors in the "Installing" section.
Getting the error when I try the following command:
lasso --main client.js --plugins lasso-marko --inject-into index....
2
votes
1
answer
88
views
Is there a way to use Marko without the require hook extension?
All of the markojs.com documentation says to render your marko templates like so:
require('marko/node-require')
require('./template.marko').render()
However, I couldn't find any ability to render ...
1
vote
1
answer
865
views
Is Marko framework active? [closed]
I've looked a the Marko framework from eBay, and it looks very promising. Actually pretty awesome. But the activity around the project seems very quiet. No videos, presentations etc on youtube the ...
0
votes
0
answers
119
views
Include marko templates into the same component
I have a marko (we use version 4.7.4) component (component.js and index.marko file) whose markup I'd like to split across multiple files. I don't want to split them out into different components and I ...
1
vote
0
answers
141
views
How to emit an event that is visible for an other sibling component in marko.js?
I would like to create a global component that will handle alert boxes and notifications on my page. The trigger will be in other sibling components
<body>
<alerts/>
<component1 /&...
2
votes
2
answers
731
views
How to simulate mouseenter event in Selenium or Javascript?
I've been working on a web UI automation task with Selenium, Javascript and SeLion. I would like to take a screenshot of some equivalent scenario as Google homepage below:
In which the "Search by ...
0
votes
2
answers
146
views
how to render UI with multiplte service calls
I just have a general question for Javascript. If I have to invoke two services for a UI and those two services calls have their own call backs, but UI template has to be rendered only after both the ...
0
votes
1
answer
139
views
correct way to use `getEls` in marko?
So I'm relatively new to marko and was just trying to follow the docs. I'm building a game with pieces.
class {
onCreate() {
this.state = {
pieces: getEls('stack'),
gameOver: false
...
-1
votes
1
answer
86
views
Do any modern UI rendering libraries cater for static XML?
Can I use React, Vue, or Marko or similar libraries to accomplish XML output?
It appears that XML output is not a feature of any of these libraries (although it does seem to be possible to inject new ...
0
votes
1
answer
396
views
Marko Header and Footer Includes
I have two Marko components that I'd like to include in other components whenever they render on an Express server: <main-header/> and <main-footer />.
components/main-header/index.marko ...
0
votes
1
answer
920
views
Marko JS on-submit
I can't get this to work, it will not console.log(this.stat.first_name) , I need to know how to access the input form values that are entered so I can change state and then make an axios post request ...
0
votes
1
answer
79
views
Allow spaces in inline elements with MarkoJS concise markup
We are using MarkoJS in our new project. I love concise scrypts but in MarkoJS it seems they trim all possible spaces.
The example is:
h1
-- hello
span
-- Diego!
Outputs:
<h1>Hello<...
1
vote
2
answers
728
views
MarkoJS for loop over array of objects
I really need help with a pretty simple and trivial problem, but here it goes. I am using marko on the server side in NodeJS and am rendering my views via:
ctx.render({
});
with koa-router and koa. ...
0
votes
1
answer
728
views
How do I include bootstrap js in a marko app using lasso?
I'd like to include the Bootstrap JS in my Marko app using Lasso. How should I go about doing that?
0
votes
1
answer
372
views
How does one access `$global` or `out.global` in non-top-level components in MarkoJS?
I'm trying to access global variables from a Marko component, but I'm getting Uncaught ReferenceError: out is not defined.
class {
onClick(event) {
console.log(out.global.message)
...
1
vote
1
answer
954
views
Styles and events not working in marko template
My component is loading fine but the styles are not loading, nor are the events firing. I am following the documentation and no errors are being thrown but it seems I might be missing something ...
1
vote
2
answers
89
views
Use component/tag contents in Marko template
Say I'd like to have a component that wraps its contents (aka children):
<article>
<header>${input.heading}</header>
<section> ... contents come here ... </section>
&...
0
votes
2
answers
673
views
How to integrate external library (slick) and utilize it into MarkoJS?
I am beginner to the MarkoJS technology. I am looking to create a carousel (slider with multiple items) component through MarkoJS. The issue i am facing to load external libraries (like Jquery) into ...
-2
votes
1
answer
542
views
Views and Partials for NodeJS?
My project uses Koa2 with Marko on the front.
I'm looking to avoid repeating layout HTML that's common on every page. Essentially splitting it out into partials and having a "main" partial (with all ...
5
votes
3
answers
2k
views
How to do client side routing in Markojs
how to do client side routing in Markojs. Is there anything inbuild like react router as in react?
0
votes
1
answer
620
views
Simple client-side rendering not working
I'm trying to render a component when the onMount is triggered in my smart component. The server seems to render the component correctly but when onMount is triggered on the client it does not render, ...
0
votes
1
answer
871
views
Correct way to emit value with Marko.js
I want a Marko.js component to emit an event along with a value, I then want the containing component to listen for the event and access the value.
I have a simple button component which looks like ...
0
votes
2
answers
659
views
How to dynamically define dependencies for a marko template being rendered in express JS route using lasso?
For example: Consider a route /theme
The route should render itself in the theme (read: LESS color variables) specified as a route/query param.
Based on the theme parameter, a custom JS script may ...