Issue with tpl.js files that are copied over, running through prettier and failing on Heroku #395
jonsherrard posted onGitHub
Bug Report
Describe the bug
npx docz build
fails on heroku, it works perfectly on our OSX machines.
It looks to me like the template files that are generated are breaking as they're generated:
import React from 'react'
import { hot } from 'react-hot-loader'
import Theme from 'docz-theme-default'
import { imports } from './imports' import db from './db.json'
const Root = () => (
<theme db="{db}" imports="{imports}" hashrouter="{" false } >
)
export default hot(module)(Root)
Once the broken files are copied over, prettier is failing to parse them.
<img width="2095" alt="screen shot 2018-10-09 at 15 10 28" src="https://user-images.githubusercontent.com/631670/46675200-c77b0180-cbd5-11e8-8ff7-91aaebf1c128.png">
β fatal SyntaxError: Unexpected token, expected ";" (1:27)
> 1 | import React from 'react' import { hot } from 'react-hot-loader' import Theme from 'docz-theme-default' import { imports } from './imports' import db from './db.json' const Root = () => (<theme db="{db}" imports="{imports}" hashrouter="{" false } >) export default hot(module)(Root)
| ^
at t (/app/node_modules/docz-utils/node_modules/prettier/parser-babylon.js:1:326)
at Object.d [as parse] (/app/node_modules/docz-utils/node_modules/prettier/parser-babylon.js:1:187968)
at Object.parse$2 [as parse] (/app/node_modules/docz-utils/node_modules/prettier/index.js:7138:19)
at coreFormat (/app/node_modules/docz-utils/node_modules/prettier/index.js:10398:23)
at format (/app/node_modules/docz-utils/node_modules/prettier/index.js:10570:16)
at formatWithCursor (/app/node_modules/docz-utils/node_modules/prettier/index.js:10582:12)
at /app/node_modules/docz-utils/node_modules/prettier/index.js:34924:15
at Object.format (/app/node_modules/docz-utils/node_modules/prettier/index.js:34943:12)
at Promise (/app/node_modules/docz-utils/lib/index.js:1:4327)
at new Promise (<anonymous>)
at Object.format (/app/node_modules/docz-utils/lib/index.js:1:4292)
at Promise (/app/node_modules/docz-core/dist/index.js:1:87660)
at new Promise (<anonymous>)
at touch (/app/node_modules/docz-core/dist/index.js:1:87581)
at writeAppFiles (/app/node_modules/docz-core/dist/index.js:1:91416)
at <anonymous>
I've created a repository with the failing build step if you deploy on Heroku here: https://github.com/shortlist-digital/tapestry-lite-docz
(I've since removed our internal library tapestry-lite
from the heroku app, and docz build
still fails.
Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.
This is really strange, and only occurs on Heroku containers.