Including layout modules

I'm attempting to include layout modules:
var FittableColumns = require('layout/FittableColumns');

But when I pack, it get this error:
20:04:21.445Z ERROR enyo-dev/process-source-stream: could not be resolved, will be reported at the end (module=layout/FittableColumns)
20:04:21.455Z ERROR enyo-dev/process-source-stream: dependency layout/FittableColumns could not be found (module=src/view/Middle)
20:04:21.455Z FATAL enyo-dev: Cannot continue due to encountered errors
I added the layout module to the library settings in my .enyoconfig file, but am still getting this error.

What am I missing?


  • Can you share your entire .enyoconfig? It might help isolate the issue.
  • { "title": "", "libDir": "lib", "paths": [], "libraries": [ "enyo", "layout" ], "sources": { "enyo": "", "layout": "" }, "targets": { "enyo": "master", "layout": "master" }, "production": false, "devMode": true, "cache": true, "resetCache": false, "trustCache": false, "cacheFile": ".enyocache", "clean": false, "sourceMaps": true, "externals": true, "strict": true, "skip": [], "library": false, "wip": false, "outDir": "builds/dev/biblesupersearch", "outFile": "index.html", "lessPlugins": [], "assetRoots": [], "lessOnlyLess": false, "minifyCss": false, "inlineCss": false, "outCssFile": "biblesupersearch.css", "outJsFile": "biblesupersearch.js", "inlineJs": true, "templateIndex": "", "watch": false, "watchPaths": [], "polling": false, "pollingInterval": 100, "headScripts": [], "tailScripts": [], "promisePolyfill": false, "styleOnly": false, "lessVars": [] }
  • edited August 2017
    lbmounse can u check ur lib folder, is "layout" inside it? if it's not, you have to get it from the npm.

    npm install enyojs/layout

    will download layout libraries to node_modules. Then just copy layout folder from node_modules to lib.
  • Yes it is now. I cloned the git repo for enyo layout to that dir to make it work.

    Since the git repo is in the sources in .enyoconfig, I assumed it would pull from there automatically. What then is the purpose of the sources?
  • That is how it should work. If you ran enyo init in the directory with that .enyoconfig, it should have installed both enyo and layout for you. I verified it did so in my setup (node 4.8.4, enyo-dev 1.0.0) so perhaps something went awry in your setup. Happy to help troubleshoot further if you'd like!
  • init Initialize a new or existing Enyo library or application. You can initialize new projects from a template and/or ensure the required (Enyo) dependencies are installed.

    So I take it that enyo init is used to make sure dependencies are up to date for existing enyo apps?
  • Update: It's working when I pack in production mode (enyo pack --production), but not in development mode.

    I get this console error in my development build:
    enyo.js:40 Uncaught Error: Could not find module "layout/FittableColumns"
Sign In or Register to comment.