We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm using cross-spawn for one of my fields.
I get the error:
Error: commons-ab523a7593dd80499e4a.js from UglifyJs SyntaxError: Unexpected character '`' [./~/cross-spawn/lib/enoent.js:6,0]
Can't provide a sample repo. But I looked at other cases: https://github.com/gatsbyjs/gatsby/issues?utf8=%E2%9C%93&q=uglifyjs
Build should finish successfully.
Error above.
System: OS: Windows 10 CPU: x64 Intel(R) Xeon(R) CPU E3-1230 v3 @ 3.30GHz Binaries: Yarn: 1.7.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 5.10.0 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 42.17134.1.0 npmPackages: gatsby: ^1.9.270 => 1.9.270 gatsby-image: ^1.0.52 => 1.0.52 gatsby-link: ^1.6.44 => 1.6.44 gatsby-plugin-catch-links: ^1.0.22 => 1.0.22 gatsby-plugin-emotion: ^1.1.17 => 1.1.17 gatsby-plugin-lodash: ^1.0.11 => 1.0.11 gatsby-plugin-manifest: ^1.0.25 => 1.0.25 gatsby-plugin-netlify: ^1.0.21 => 1.0.21 gatsby-plugin-offline: ^1.0.18 => 1.0.18 gatsby-plugin-react-helmet: ^2.0.11 => 2.0.11 gatsby-plugin-react-next: ^1.0.11 => 1.0.11 gatsby-plugin-sharp: ^1.6.47 => 1.6.47 gatsby-plugin-sitemap: ^1.2.25 => 1.2.25 gatsby-plugin-typography: ^1.7.18 => 1.7.18 gatsby-remark-autolink-headers: ^1.4.18 => 1.4.18 gatsby-remark-design-system: ^1.0.9 => 1.0.9 gatsby-remark-external-links: ^0.0.4 => 0.0.4 gatsby-remark-prismjs: ^2.0.3 => 2.0.3 gatsby-source-filesystem: ^1.5.38 => 1.5.38 gatsby-transformer-remark: ^1.7.42 => 1.7.42 gatsby-transformer-sharp: ^1.6.26 => 1.6.26
gatsby-node
const path = require('path'); const { createFilePath } = require('gatsby-source-filesystem'); const { toTitleCase, getLastUpdatedTimestamp } = require('./src/utilities'); const getSlugParents = slug => { const slugParentString = slug.substring(1, slug.length - 1); return slugParentString.split('/'); }; exports.onCreateNode = ({ node, getNode, boundActionCreators }) => { const { createNodeField } = boundActionCreators; if (node.internal.type === 'MarkdownRemark') { const slug = createFilePath({ node, getNode, basePath: 'pages' }); const slugParentsArr = getSlugParents(slug); createNodeField({ node, name: 'slug', value: slug, }); createNodeField({ node, name: 'topLevelDir', value: toTitleCase(slugParentsArr[0]), }); createNodeField({ node, name: 'subDir', value: toTitleCase(slugParentsArr.length > 2 ? slugParentsArr[1] : ''), }); } }; exports.createPages = ({ graphql, boundActionCreators }) => { const { createPage } = boundActionCreators; return new Promise((resolve, reject) => { const docPage = path.resolve('src/templates/doc.jsx'); resolve( graphql(` { docs: allMarkdownRemark { edges { node { fileAbsolutePath fields { slug topLevelDir subDir } frontmatter { title } } } } } `).then(result => { if (result.errors) { console.log(result.errors); reject(result.errors); } const docsList = result.data.docs.edges; docsList.forEach(project => { createPage({ path: project.node.fields.slug, component: docPage, context: { slug: project.node.fields.slug, topLevelDir: project.node.fields.topLevelDir, subDir: project.node.fields.subDir, lastUpdated: getLastUpdatedTimestamp(project.node.fileAbsolutePath), }, }); }); }) ); }); }; exports.modifyWebpackConfig = ({ config, stage }) => { config.merge({ node: { fs: 'empty', child_process: 'empty' }, resolve: { root: path.resolve(config._config.context, 'src'), }, }); return config; };
getLastUpdatedTimestamp:
const spawn = require('cross-spawn'); exports.getLastUpdatedTimestamp = filepath => parseInt(spawn.sync('git', ['log', '-1', '--format=%ct', filepath]).stdout.toString('utf-8'), 10) * 1000;
The text was updated successfully, but these errors were encountered:
Is this another instance of #3780?
Sorry, something went wrong.
@m-allanson Maybe... But isn't the mentioned line es5? https://github.com/moxystudio/node-cross-spawn/blob/master/lib/enoent.js
Follow-up question: Are the changes mentioned by Kyle in the linked issue implemented?
Since Gatsby v2 solves all my issues with that I'm closing this one.
No branches or pull requests
Description
I'm using cross-spawn for one of my fields.
I get the error:
Steps to reproduce
Can't provide a sample repo. But I looked at other cases:
https://github.com/gatsbyjs/gatsby/issues?utf8=%E2%9C%93&q=uglifyjs
Expected result
Build should finish successfully.
Actual result
Error above.
Environment
System:
OS: Windows 10
CPU: x64 Intel(R) Xeon(R) CPU E3-1230 v3 @ 3.30GHz
Binaries:
Yarn: 1.7.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 5.10.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 42.17134.1.0
npmPackages:
gatsby: ^1.9.270 => 1.9.270
gatsby-image: ^1.0.52 => 1.0.52
gatsby-link: ^1.6.44 => 1.6.44
gatsby-plugin-catch-links: ^1.0.22 => 1.0.22
gatsby-plugin-emotion: ^1.1.17 => 1.1.17
gatsby-plugin-lodash: ^1.0.11 => 1.0.11
gatsby-plugin-manifest: ^1.0.25 => 1.0.25
gatsby-plugin-netlify: ^1.0.21 => 1.0.21
gatsby-plugin-offline: ^1.0.18 => 1.0.18
gatsby-plugin-react-helmet: ^2.0.11 => 2.0.11
gatsby-plugin-react-next: ^1.0.11 => 1.0.11
gatsby-plugin-sharp: ^1.6.47 => 1.6.47
gatsby-plugin-sitemap: ^1.2.25 => 1.2.25
gatsby-plugin-typography: ^1.7.18 => 1.7.18
gatsby-remark-autolink-headers: ^1.4.18 => 1.4.18
gatsby-remark-design-system: ^1.0.9 => 1.0.9
gatsby-remark-external-links: ^0.0.4 => 0.0.4
gatsby-remark-prismjs: ^2.0.3 => 2.0.3
gatsby-source-filesystem: ^1.5.38 => 1.5.38
gatsby-transformer-remark: ^1.7.42 => 1.7.42
gatsby-transformer-sharp: ^1.6.26 => 1.6.26
File contents (if changed)
gatsby-node
getLastUpdatedTimestamp:
The text was updated successfully, but these errors were encountered: