marko-js / marko

A declarative, HTML-based language that makes building web apps fun
https://markojs.com/
MIT License
13.37k stars 644 forks source link

Webpack integration tutorial not working #617

Closed leili2017 closed 7 years ago

leili2017 commented 7 years ago

New Feature

Description

Context

Possible Implementation

Open Questions

Is this something you're interested in working on?

Bug Report

I started out following the webpack-marko integration tutorial on http://markojs.com/docs/webpack/ and got the error message "error in cannot find module 'marko/compiler' " even with webpack version 1.14.0.

Context

image

Expected Behavior

Actual Behavior

Possible Fix

Additional Info ### Your Environment * Version used: * Environment name and version (e.g. Chrome 39, node.js 5.4): * Operating System and version (desktop or mobile): * Link to your project: ### Steps to Reproduce 1. 2. 3. 4. ### Stack Trace
jrop commented 7 years ago

I think this is because marko-loader does not depend on the marko package. If you install the marko package this should work:

npm install --save-dev marko
# or
yarn add --dev marko
mlrawlings commented 7 years ago

@leili2017 can you confirm that installing marko as @jrop suggested works?

In any case, we should make it clear in the docs that you need to have marko as a dependency of your project

jrop commented 7 years ago

To be clear, this is consistent behavior for any webpack *-loader: For example, when using the babel-loader, babel-core needs to be installed separately.

wujjpp commented 7 years ago

Try this , if you like marko starter kit