Canary branch still getting the "SyntaxError: Unexpected identifier" error for imports
See original GitHub issueI upgraded to the canary version however I’m still getting the following error:
SyntaxError: Unexpected identifier
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.@tidyiq/core/next/_app (C:\Users\Me\Websites\Boilerplate\dist\.next\server\static\development\pages\_app.js:1108:18)
at __webpack_require__ (C:\Users\Me\Websites\Boilerplate\dist\.next\server\static\development\pages\_app.js:23:31)
at Module../pages/_app.js (C:\Users\Me\Websites\Boilerplate\dist\.next\server\static\development\pages\_app.js:1049:79)
at __webpack_require__ (C:\Users\Me\Websites\Boilerplate\dist\.next\server\static\development\pages\_app.js:23:31)
at Object.0 (C:\Users\Me\Websites\Boilerplate\dist\.next\server\static\development\pages\_app.js:1096:18)
at __webpack_require__ (C:\Users\Me\Websites\Boilerplate\dist\.next\server\static\development\pages\_app.js:23:31)
C:\Users\Me\Websites\Boilerplate\dist\node_modules\@tidyiq\core\next\_app.js:1
(function (exports, require, module, __filename, __dirname) { import React, { useEffect } from "react";
Contents of node_modules/@tidyiq/core/next/_app.js:
import React, { useEffect } from "react";
import CssBaseline from "@material-ui/core/CssBaseline";
import { ThemeProvider } from "@material-ui/styles";
import theme from "../theme/createTheme";
import { StateProvider } from "../state/store";
const AppProvider = ({ children }) => {
useEffect(() => {
const jssStyles = document.querySelector("#jss-server-side");
if (jssStyles && jssStyles.parentNode) {
jssStyles.parentNode.removeChild(jssStyles);
}
});
return (React.createElement(StateProvider, null,
React.createElement(ThemeProvider, { theme: theme },
React.createElement(CssBaseline, null),
children)));
};
export default AppProvider;
Contents of pages/app.js:
import React from "react";
import App, { Container } from "next/app";
import AppProvider from "@tidyiq/core/next/_app";
class MyApp extends App {
render() {
const { Component, pageProps } = this.props;
return (React.createElement(Container, null,
React.createElement(AppProvider, null,
React.createElement(Component, Object.assign({}, pageProps)))));
}
}
export default MyApp;
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Canary branch still getting the "SyntaxError: Unexpected ...
This looks like a webpack bug, for some reason it's not detecting commonjs and not providing the exports key. Can you please file...
Read more >Unexpected identifier' for import statement using Jest with ...
Receiving error 'SyntaxError: Unexpected identifier' for import statement ... Previously, Jest worked fine with import statements; however, ...
Read more >syntaxerror: unexpected identifier - You.com | The AI Search ...
Importing node.js module - SyntaxError: Unexpected identifier ... I upgraded to the canary version however I'm still getting the following error:.
Read more >SyntaxError: Unexpected '#' used outside of class body
The JavaScript exception "Unexpected '#' used outside of class body" occurs when a hash ("#") is encountered in an unexpected context, most notably...
Read more >Testing Guide - OWASP Foundation
The OWASP Testing Guide has an import- ant role to play in solving this serious issue. It is vitally important that our approach...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

OK I just updated to canary again. The error is:
I’ll create a separate issue for it
Oh sorry, you meant for the new issue with
ReferenceError: exports is not defined. OK sure, I’ll provide a repo shortly