"import createServer from 'next'" is no longer working version 14.0.3
Unanswered
Capelin posted this in #help-forum
CapelinOP
I use the following code to create a server in my application. It was working without any issues until I updated to the latest version, 14.0.3. For some unknown reason, the value of createServer is now undefined. Any help would be greatly appreciated.
import createServer from 'next';
const serverOptions = {...};
const server = createServer(serverOptions);
await server.prepare();7 Replies
Toyger
probably you updated it wrong, here is freshly installed
CapelinOP
@Toyger thank you for your message. I have literally the same version and as you can see in the below pic, "createServer" is undefined.
Toyger
hmm, try to reinstall it, or create a new clean project an check if createServer works ok, then move your code here.
CapelinOP
I did all of that but still no result.
CapelinOP
I got it to work finally. Thank you!
For some reason "import createServer from 'next;' " is not working. So I switched to "const createServer = require('next');"