derbyjs / derby-examples

Example applications for the Derby framework
http://derbyjs.com/
283 stars 74 forks source link

Directory example throws error on start #67

Closed briceicle closed 5 years ago

briceicle commented 5 years ago

when I cd into the directory example and run:

node server.js

I get:

/Users/brice/src/derby-examples/node_modules/resolve/lib/sync.js:123
            if (pkg.main) {
                    ^

TypeError: Cannot read property 'main' of undefined
    at loadAsDirectorySync (/Users/brice/src/derby-examples/node_modules/resolve/lib/sync.js:123:21)
    at Function.module.exports [as sync] (/Users/brice/src/derby-examples/node_modules/resolve/lib/sync.js:49:40)
    at Object.loadViewsSync (/Users/brice/src/derby-examples/node_modules/derby/lib/files.js:21:26)
    at App.loadViews (/Users/brice/src/derby-examples/node_modules/derby/lib/App.server.js:216:20)
    at App.component (/Users/brice/src/derby-examples/node_modules/derby/lib/App.js:192:10)
    at Object.<anonymous> (/Users/brice/src/derby-examples/directory/index.js:7:5)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)

This line app.component(require('d-connection-alert')); seems to be the culprit but I'm not sure why.

node -v = v10.15.1 MongoDB shell version: 4.0.6 redis-cli 5.0.3

briceicle commented 5 years ago

To get the app to work, I have to remove app.component(require('d-connection-alert')); from index.js and <view is="d-connection-alert"></view> from index.html.