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

createBundleRenderer('/path/to/bundle.json') failed #5037

Closed
wongyouth opened this issue Feb 28, 2017 · 1 comment
Closed

createBundleRenderer('/path/to/bundle.json') failed #5037

wongyouth opened this issue Feb 28, 2017 · 1 comment

Comments

@wongyouth
Copy link

createBundleRenderer('/path/to/bundle.json') failed.
but createBundleRenderer(require('/path/to/bundle.json')) succeed

And I found the pattern /\.json$/ is tested based on file content but not based on file name:

bundle = fs.readFileSync(bundle, 'utf-8')
   if (/\.json$/.test(bundle)) {

see
https://github.com/vuejs/vue/blob/dev/src/server/create-bundle-renderer.js#L47-L48

@yyx990803
Copy link
Member

Thanks for locating the problem!

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