I updated my version of reactJS from v15.6.1 to v16.0 and Next.js from 3.2.2 to 4.0.0-beta.2.
I run my npm run dev as usual and I got this message error:
Internal Server Error
An internal server error occurred.
Unexpected token export
/Users/pierre/Desktop/TAP-WEBAPP/.next/dist/css/main.scss:1
(function (exports, require, module, __filename, __dirname) { export default "#charset \"UTF-8\";\n.ease-in, .navbar__main__section:hover, .nav__chapter--isSelected {\n transition: all 100ms cubic-bezier(0.42, 0, 1, 1);\n /* ease-in */ }\n\n.ease-out, .navbar__main__section {\n transition: all 100ms cubic-bezier(0, 0, 0.58, 1);\n /* ease-out */ }\n\n.swift-in {\n transition: all 3000ms cubic-bezier(0, 0, 0.58, 1); }\n\n/*!\n * Font Awesome 4.7.0 by #davegandy - http://fontawesome.io - #fontawesome\n * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n */\n/* FONT PATH\n * -------------------------- */\n#font-face {\n font-family: 'FontAwesome';\n src: url(\"../fonts/fontawesome-webfont.eot?v=4.7.0\");\n src: url(\"../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0\") format(\"embedded-opentype\"), url(\"../fonts/fontawesome-webfont.woff2?v=4.7.0\") format(\"woff2\"), url(\"../fonts/fontawesome-webfont.woff?v=4.7.
SyntaxError: Unexpected token export
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:588:28)
at Module._compile (/Users/pierre/Desktop/TAP-WEBAPP/node_modules/source-map-support/source-map-support.js:492:25)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/pierre/Desktop/TAP-WEBAPP/components/General/Header.js:5:1)
at Module._compile (module.js:624:30)
at Module._compile (/Users/pierre/Desktop/TAP-WEBAPP/node_modules/source-map-support/source-map-support.js:492:25)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
Any ideas whats wrong there?
Next.js 4 is out of the beta. Had a similar issue and upgrading to next.js 4 fixed it. Could you upgrade from the beta with
$ npm install next#latest --save
and report back?
Related
````your text ERROR in ./app/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
C:\Users\Projects\Multipayment\sample-browser-ui\src\node_modules\babel-plugin-twin\index.js:15
const matchedExclude = (state.opts.exclude ?? []).find((regex) =>
SyntaxError: Unexpected token '?'
at Module._compile (internal/modules/cjs/loader.js:895:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at requireModule (C:\Users\Projects\Multipayment\sample-browser-ui\src\node_modules\#babel\core\lib\config\files\plugins.js:165:12)
at loadPlugin (C:\Users\Projects\Multipayment\sample-browser-ui\src\node_modules\#babel\core\lib\config\files\plugins.js:68:17)
at createDescriptor (C:\Users\Projects\Multipayment\sample-browser-ui\src\node_modules\#babel\core\lib\config\config-descriptors.js:154:9)
at C:\Users\Projects\Multipayment\sample-browser-ui\src\node_modules\#babel\core\lib\config\config-descriptors.js:109:50
# multi ./node_modules/react-app-polyfill/ie11.js webpack-hot-middleware/client?reload=true react-hot-loader/patch ./app/app.js main[3]
Getting error on npm start `
i have some Problems with my Code that somehow none of my friends have ...
Some Code to see:
module.exports = {
data: new SlashCommandBuilder()
.setName('equipment')
.setDescription('Gives you Information about specific Equipments')
.addStringOption(option =>
option.setName('type')
.setDescription('Specify the Equipment')
.setRequired(true)
.addChoice('Flashlight', 'flashlight')
),
...
The Code is Cut here because its not necesery for it above to work.
My Error Code:
PS C:\Users\enric\Desktop\Ghosty Phasmo Help> node .
C:\Users\enric\Desktop\Ghosty Phasmo Help\commands\phasmo\equipment.js:15
.addChoice('Flashlight', 'flashlight')
^
TypeError: option.setName(...).setDescription(...).setRequired(...).addChoice is not a function
at C:\Users\enric\Desktop\Ghosty Phasmo Help\commands\phasmo\equipment.js:15:18
at MixedClass._sharedAddOptionMethod (C:\Users\enric\Desktop\Ghosty Phasmo Help\node_modules\#discordjs\builders\dist\index.js:1334:50)
at MixedClass.addStringOption (C:\Users\enric\Desktop\Ghosty Phasmo Help\node_modules\#discordjs\builders\dist\index.js:1323:17)
at Object.<anonymous> (C:\Users\enric\Desktop\Ghosty Phasmo Help\commands\phasmo\equipment.js:11:7)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
Somehow my Discord.js thinks that im using a Function. I copied the Code from other friends where this completely work. but somehow the same Error message appears.
.addChoice() is outdated. Now, there is only .addChoices() (with an s)
.addStringOption(option =>
option.setName('type')
.setDescription('Specify the Equipment')
.setRequired(true)
.addChoices({
name: 'Flashlight',
value: 'flashlight'
})
)
I am trying to run npm run build on my NextJs project. The terminal says:
info - Loaded env from /mnt/c/Users/chloe/case4/2022-ca400-TEMPLATE/src/sage-project/.env.local
error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
> Build error occurred
ReferenceError: withTM is not defined
at Object.<anonymous> (/mnt/c/Users/chloe/case4/2022-ca400-TEMPLATE/src/sage-project/next.config.js:13:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:190:29)
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:437:15)
and my next.config.js file looks like this:
/** #type {import('next').NextConfig} */
const withTM = require("next-transpile-modules")([
"#fullcalendar/common",
"#babel/preset-react",
"#fullcalendar/common",
"#fullcalendar/daygrid",
"#fullcalendar/interaction",
"#fullcalendar/react",
"#fullcalendar/timegrid",
]);
module.exports = withTM({
reactStrictMode: true
});
It says withTM isn't defined, but it is with const? Where am I going wrong?
I'm getting this error:
I tried to install Npm again, if anyone comes across I would be happy to help
node:internal/modules/cjs/loader:936
throw err;
^
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\yehon\\OneDrive\\שולחן העבודה\\yehonatan\\Work_projects\\Manhattan-client-13-03-2022_v2\\config\\paths.js',
'C:\\Users\\yehon\\OneDrive\\שולחן העבודה\\yehonatan\\Work_projects\\Manhattan-client-13-03-2022_v2\\config\\env.js',
'C:\\Users\\yehon\\OneDrive\\שולחן העבודה\\yehonatan\\Work_projects\\Manhattan-client-13-03-2022_v2\\scripts\\start.js'
]
}
We have a hybrid Angular6 and AngularJS 1.6 project which we are currently migrating. In this process, we also want to introduce Server Side Rendering (SSR).
The problem is, that the SSR is running in a node environment, so running the SSR/prerendering gets the following error:
npm-run ts-node ./prerender.ts
[..]/node_modules/angular/index.js:2
**module.exports = angular;**
**ReferenceError: angular is not defined**
at Object.<anonymous> ([..]/node_modules/angular/index.js:2:18)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.angular ([..]/dist/server/webpack:/external "angular":1:1)
at _webpack_require_
([..]/dist/server/webpack:/webpack/bootstrap:19:1)
import 'zone.js/dist/zone-node';
import 'reflect-metadata';
import {renderModuleFactory} from '#angular/platform-server';
import {writeFileSync} from 'fs';
const globalAny:any = global;
const Window = require('window');
let window = new Window();
globalAny.window = window;
globalAny.document = window.document;
const {AppServerModuleNgFactory} = require('./dist/server/main');
renderModuleFactory(AppServerModuleNgFactory, {
document: '<app-root></app-root>',
url: '/'
})
.then(html => {
console.log('Pre-rendering successful, saving prerender.html');
writeFileSync('./prerender.html', html);
})
.catch(error => {
console.error('Error occurred:', error);
});
The Project is based on the universal-starter repo: https://github.com/angular/universal-starter
Any suggestions what's going on here?