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

config.web: ValidationError: "assets" is not allowed #12

Open
jaumard opened this issue Apr 19, 2016 · 15 comments
Open

config.web: ValidationError: "assets" is not allowed #12

jaumard opened this issue Apr 19, 2016 · 15 comments

Comments

@jaumard
Copy link

jaumard commented Apr 19, 2016

With Trails integration it's not working, I have this error :

 TypeError: config.web: ValidationError: "assets" is not allowed
    at /Users/jaumard/IdeaProjects/trailsmix/node_modules/trailpack-hapi/lib/validator.js:9:32
    at internals.Any.applyFunctionToChildren.internals.Any._validateWithOptions (/Users/jaumard/IdeaProjects/trailsmix/node_modules/trailpack-hapi/node_modules/joi/lib/any.js:648:16)
    at root.validate (/Users/jaumard/IdeaProjects/trailsmix/node_modules/trailpack-hapi/node_modules/joi/lib/index.js:103:23)
    at /Users/jaumard/IdeaProjects/trailsmix/node_modules/trailpack-hapi/lib/validator.js:8:11
    at Object.validateWebConfig (/Users/jaumard/IdeaProjects/trailsmix/node_modules/trailpack-hapi/lib/validator.js:7:12)
    at Hapi.validate (/Users/jaumard/IdeaProjects/trailsmix/node_modules/trailpack-hapi/index.js:27:21)
    at /Users/jaumard/IdeaProjects/trailsmix/node_modules/trails/lib/trailpack.js:61:26
    at process._tickDomainCallback (node.js:407:9)
    at Function.Module.runMain (module.js:443:11)
    at startup (node.js:134:18)
    at node.js:962:3

If I remove assets server is started but static/bundle.js 404 (Not Found) I check the folder and it's empty :(

@weyj4
Copy link
Member

weyj4 commented Apr 19, 2016

This is related to recent changes here: https://github.com/trailsjs/trailpack-hapi, we've changed where you specify assets from config.web.assets to config.main.paths.www.

However, you still have to clone and symlink trailpack-hapi because we haven't pushed those changes to npm yet.

@weyj4 weyj4 mentioned this issue Apr 19, 2016
@jaumard
Copy link
Author

jaumard commented Apr 19, 2016

I understand :) I replace by trailpack-express4 ^^ any idea why webpack didn't generate assets at all ?

@weyj4
Copy link
Member

weyj4 commented Apr 19, 2016

Interesting. So once you replaced w/ express, webpack didn't work? There should be no connection.

@jaumard
Copy link
Author

jaumard commented Apr 19, 2016

No hapi or express it's the same :) webpack doesn't generate anything. I just replace hapi by express to fix assets error and not have to simlink it

@weyj4
Copy link
Member

weyj4 commented Apr 19, 2016

Oh ok. Give me a minute to try and replicate.

@weyj4
Copy link
Member

weyj4 commented Apr 19, 2016

So my instance is working fine after cloning and symlinking trailpack-hapi. Is the static directory not getting created?

@jaumard
Copy link
Author

jaumard commented Apr 19, 2016

static is generated with under log and sockets but all is empty...

@jaumard
Copy link
Author

jaumard commented Apr 19, 2016

Ho just see this :

Version: webpack 1.12.9
Time: 6ms
    Asset     Size  Chunks       Chunk Names
bundle.js  21.3 kB       0       main

ERROR in Cannot find module 'lodash/lang/isFunction'
 @ multi main

Any idea ? Missing dependency ?

@weyj4
Copy link
Member

weyj4 commented Apr 19, 2016

lodash should be a dependency...

@weyj4
Copy link
Member

weyj4 commented Apr 19, 2016

mine looks like this

trails > debug: trails event: repl:started
debug: trailpack-webpack: Build Info
Hash: da049cded0d003c4e4bf
Version: webpack 1.13.0
Time: 10078ms
                        Asset       Size  Chunks             Chunk Names
              fonts/Grunt.svg    40.4 kB          [emitted]
          fonts/devicons.woff     101 kB          [emitted]
fonts/fontawesome-webfont.ttf     142 kB          [emitted]
               fonts/logo.svg    7.71 kB          [emitted]
              fonts/Auth0.svg    1.12 kB          [emitted]
              fonts/Bower.svg    6.74 kB          [emitted]
         fonts/Browserify.svg    16.4 kB          [emitted]
            fonts/Express.svg    11.6 kB          [emitted]
      fonts/OpenSansEmoji.ttf     562 kB          [emitted]
               fonts/Gulp.svg    3.75 kB          [emitted]
               fonts/Hapi.svg     128 kB          [emitted]
                fonts/JWT.svg    2.14 kB          [emitted]
                fonts/Koa.svg    2.06 kB          [emitted]
           fonts/Passport.svg  768 bytes          [emitted]
            fonts/Webpack.svg    1.36 kB          [emitted]
                    bundle.js    1.55 MB       0             main

@weyj4
Copy link
Member

weyj4 commented Apr 19, 2016

Can you try cloning/symlinking trailpack-hapi? Want to minimize variables :)

@jaumard
Copy link
Author

jaumard commented Apr 19, 2016

Ok it's work now ! I remove node_modules and npm i again. Now files are generated :) Thanks for your help !

@weyj4
Copy link
Member

weyj4 commented Apr 19, 2016

Oh, thank you! I'm still not sure what was wrong though, do you think it was express?

@jaumard
Copy link
Author

jaumard commented Apr 19, 2016

Nope because I keep it ^^ I think my first npm i doesn't finish correctly and miss some lodash dependencies...(or keep an old version)

Also I see some dependencies that (I think) need to be removed like https://github.com/trailsjs/trailsmix/blob/master/package.json#L46 ??

@jaumard
Copy link
Author

jaumard commented Apr 19, 2016

Babel doesn't look happy about lodash

[BABEL] Note: The code generator has deoptimised the styling of "/Users/jaumard/IdeaProjects/trailsmix/node_modules/lodash/lodash.js" as it exceeds the max of "100KB".

Do you have this too ?

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