Next.js: Getting Error: commons.js from UglifyJs Unexpected character '`' in Scoped stylesheets with PostCSS example

Created on 2 Jun 2017  路  5Comments  路  Source: vercel/next.js

Im getting the following error when trying tu npm run build the Scoped stylesheets with PostCSS example

Failed to build on /var/folders/_1/5rqbkkln7lbflg4lydjygw100000gn/T/e73336a2-8de1-4624-9d0d-a8a2e5bc1663 { Error: commons.js from UglifyJs Unexpected character '' [commons.js:9118,17]`

Any ideas? I prefer not to disable Uglify

Most helpful comment

@cosivox how did you replace 'em in next.config.js?

All 5 comments

Ok I've figured it out. I've replaced string literals with ' in next.config.js

@cosivox how did you replace 'em in next.config.js?

@cosivox Mind updating?

This works for me

{
    loader: 'skeleton-loader',
    options: {
        procedure(content) {
            const fileName = this._module.userRequest + '.json';
            const classNames = fs.readFileSync(fileName, 'utf8');
            trash(fileName);
            return [
                'module.exports = {',
                    'classNames: ' + classNames + ',',
                    'stylesheet: "' + content + '"',
                '}'
            ].join('');
        }
    }
},

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

Was this page helpful?
0 / 5 - 0 ratings