Skip to content
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

Issue with documentation about how to use plugins #33

Open
maxmilton opened this issue Dec 19, 2017 · 3 comments
Open

Issue with documentation about how to use plugins #33

maxmilton opened this issue Dec 19, 2017 · 3 comments

Comments

@maxmilton
Copy link

Part 1

When using plugins with marko-starter it throws an error:
TypeError: Cannot assign to read only property 'name' of function.

Click to expand full error
[marko-starter plugins] Installed plugin: lasso
(node:24324) UnhandledPromiseRejectionWarning: TypeError: Cannot assign to read only property 'name' of function 'function (lasso, config) {

    var sassHandler = {
        properties: {
            path: 'string',
         ...<omitted>...
}'
    at plugins.forEach (/home/max/Development/prowearegenkicom/auth/node_modules/marko-starter/src/plugin-manager.js:39:17)
    at Array.forEach (<anonymous>)
    at Object.exports.installPlugins (/home/max/Development/prowearegenkicom/auth/node_modules/marko-starter/src/plugin-manager.js:32:11)
    at beforeStartPromise.then (/home/max/Development/prowearegenkicom/auth/node_modules/marko-starter/index.js:75:25)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
    at Function.Module.runMain (module.js:703:11)
    at startup (bootstrap_node.js:194:16)
    at bootstrap_node.js:618:3
(node:24324) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:24324) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

To reproduce use a project.js like:

module.exports = require("marko-starter").projectConfig({
  plugins: [
    'lasso-sass',
  ],
});

with package versions:

"lasso-sass": "3.0.0",
"marko": "4.7.4",
"marko-starter": "2.0.2",

Part 2

If instead you use a project.js like:

module.exports = require("marko-starter").projectConfig({
  plugins: [
    {
      plugin: 'lasso-sass',
    },
  ],
});

You'll get a different error:
TypeError: plugin.install is not a function

Click to expand full error
[marko-starter plugins] Installed plugin: lasso
(node:25444) UnhandledPromiseRejectionWarning: TypeError: plugin.install is not a function
    at plugins.forEach (/home/max/Development/prowearegenkicom/auth/node_modules/marko-starter/src/plugin-manager.js:41:12)
    at Array.forEach (<anonymous>)
    at Object.exports.installPlugins (/home/max/Development/prowearegenkicom/auth/node_modules/marko-starter/src/plugin-manager.js:32:11)
    at beforeStartPromise.then (/home/max/Development/prowearegenkicom/auth/node_modules/marko-starter/index.js:75:25)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
    at Function.Module.runMain (module.js:703:11)
    at startup (bootstrap_node.js:194:16)
    at bootstrap_node.js:618:3
(node:25444) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:25444) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

The debugging experience with lasso/marko has been frustrating to say the least.

@maxmilton
Copy link
Author

Following up on this, the correct way to specify plugins are to use a project.js like:

module.exports = require("marko-starter").projectConfig({
  lassoConfig: {
    plugins: [
      "lasso-marko",
      "lasso-sass",
    ],
  },
});

From: https://github.com/marko-js/markojs-website/blob/master/project.js

So the real issue here is the lack of correct documentation. I still have no idea what the top level plugins is for.

@maxmilton maxmilton changed the title [BUG] Not able to use plugins due to TypeErrors Issue with documentation about how to use plugins Dec 19, 2017
@austinkelleher
Copy link
Collaborator

@maxmilton Sorry for the confusion. We should definitely update the documentation to reflect this. Would be interested in working on updating the docs? Thanks!

@maxmilton
Copy link
Author

Sure, I'll have a go at updating the readme when I have some free time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants