Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

[plugin-public-assets] Can't find public folder #1256

Open
jcayzac opened this issue Jul 1, 2018 · 2 comments
Open

[plugin-public-assets] Can't find public folder #1256

jcayzac opened this issue Jul 1, 2018 · 2 comments

Comments

@jcayzac
Copy link

jcayzac commented Jul 1, 2018

My phenomic.config.js file has:

module.exports = {
  …
  plugins: [
    …
    ['@phenomic/plugin-public-assets', { path: __dirname + '/public' }],

The directory is present, but the public assets plugin can't find it:

blog [master *$ u= origin/master] yarn start
⚠ @phenomic/plugin-public-assets:  No '/Users/jcayzac/Desktop/Phenomic/blog/public'
folder found. Please create this folder if you want static files to be served from the root
(eg: favicon.ico).
…
blog [master *$ u= origin/master] ls /Users/jcayzac/Desktop/Phenomic/blog/public
favicon.ico  robots.txt
@jcayzac
Copy link
Author

jcayzac commented Jul 1, 2018

It's probably because https://github.com/phenomic/phenomic/blob/master/packages/plugin-public-assets/src/index.js#L35 does path.join(config.path, options.path) and thus doesn't support absolute paths. Changing to { path: 'public' } fixed my problem.

Also worth mentioning that not specifying the path option resulted in the error below. Not sure why the react preset doesn't suffer from it.

✖ @phenomic/core:  The "path" argument must be of type string. Received type undefined
✖ @phenomic/core:  TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at assertPath (path.js:39:11)
    at Object.join (path.js:1157:7)
    at Object.addDevServerMiddlewares (/Users/jcayzac/Desktop/Phenomic/blog/node_modules/@phenomic/plugin-public-assets/lib/index.js:50:52)

@MoOx
Copy link
Owner

MoOx commented Jul 27, 2018

Thanks for the feedbacks. Will try to improve that.

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

No branches or pull requests

2 participants