codeapp
codeapp copied to clipboard
Program interrupted. This could be caused by a memory limit or an error in your code.
Wasn’t able to use this app at all even with a very basic code!
Same issue here, can‘t execute the „Creating a Node.js“ sample project.
Let me know your device model and the iOS version for me to reproduce this problem.
Sorry, totally forgot. Device: iPad Pro M2 Gen 6 iOS: 16.4.1
Same issue on my iPhone 13 with same iOS version.
I also encountered this situation, and when using the npm i installation package, this error was reported. Device: iPad mini6 IOS:15.4.1
让我知道您的设备型号和iOS版本,以便我重现此问题。
I also encountered this situation, and when using the npm i installation package, this error was reported. Device: iPad mini6 IOS:15.4.1
same error here
Same issue. I think it just comes down to a limitation of this app for error handling.
TLDR
This error is telling you there's a problem with your code, but the app cannot tell you what that problem is, or what file and line it's coming from in many cases.
Examples
Here's some examples in Node.js:
-
Running
nodemon app.js
ERROR:Program interrupted. This could be caused by a memory limit or an error in your code
Solution: Just usenode app.js
. Installing nodemon globally or as an app dependency doesn't work. You can't use nodemon with this platform. And it just doesn't know how to tell you that. -
Running
node app.js
with node package "Mongoose" ERROR:Program interrupted. This could be caused by a memory limit or an error in your code
Solution: In my case, I was using deprecated syntax from an old version of mongoose. Just had to guess that was the problem and update per the docs. This error is explained in VSCode. But this app is missing something to show that output. -
Stopping a node app with
ctrl-c
ERROR:Program interrupted. This could be caused by a memory limit or an error in your code
Solution: This is weird. There really is no problem. I'm just stopping the process like normal. But this app handles it like something went wrong. Kinda misleading.
Conclusion
Most desktop IDE/Editor solutions will tell you at least what file the problem is coming from. But in many cases, both the terminal and console output just can't offer any helpful hints. And speaking of the console (listed simply as 'problems' in the editor), well it has no badge or color to tell you one when an error has occurred.
I'm thrilled that something like this app even exists for iOS. Let alone one that is free and privacy respecting. We just need more detailed error handling to make this usable for daily work.
Device: iPad Pro 3rd Gen
OS: iPadOS 16.5
Code App Version: 1.4.4
Same error here… doesn't support creating new angular and react projects?
I tried it with a very-very simple react project and i got the same. Something is broken in the application.
Device: iPad Pro 3rd Gen OS: iPadOS 17.0 (Beta 4) Code App Version: 1.4.5
I tried it with a very-very simple react project and i got the same. Something is broken in the application.
Device: iPad Pro 3rd Gen
OS: iPadOS 17.0 (Beta 4)
Code App Version: 1.4.5
Please use our React sample as a starting point: https://github.com/thebaselab/react-starter.
I tried it with a very-very simple react project and i got the same. Something is broken in the application.
Device: iPad Pro 3rd Gen
OS: iPadOS 17.0 (Beta 4) Code App Version: 1.4.5
Please use our React sample as a starting point: https://github.com/thebaselab/react-starter.
Yeah that's run, but what's the point if my own projects isn't...
I tried it with a very-very simple react project and i got the same. Something is broken in the application.
Device: iPad Pro 3rd Gen
OS: iPadOS 17.0 (Beta 4)
Code App Version: 1.4.5
Please use our React sample as a starting point: https://github.com/thebaselab/react-starter.
Yeah that's run, but what's the point if my own projects isn't...
You can. It's just certain commands aren't available on Code App because of iOS's restriction. Usually, they try to spawn sub-processes.
You might send me a copy of your project at [email protected] and I will patch it for you.
I tried it with a very-very simple react project and i got the same. Something is broken in the application.
Device: iPad Pro 3rd Gen
OS: iPadOS 17.0 (Beta 4)
Code App Version: 1.4.5
Please use our React sample as a starting point: https://github.com/thebaselab/react-starter.
Yeah that's run, but what's the point if my own projects isn't...
You can. It's just certain commands aren't available on Code App because of iOS's restriction. Usually, they try to spawn sub-processes.
You might send me a copy of your project at [email protected] and I will patch it for you.
I take your answer as a kind joke. :) Of course i won't going to share these projects mostly because of security concerns...
I tried it with a very-very simple react project and i got the same. Something is broken in the application.
Device: iPad Pro 3rd Gen
OS: iPadOS 17.0 (Beta 4)
Code App Version: 1.4.5
Please use our React sample as a starting point: https://github.com/thebaselab/react-starter.
Yeah that's run, but what's the point if my own projects isn't...
You can. It's just certain commands aren't available on Code App because of iOS's restriction. Usually, they try to spawn sub-processes.
You might send me a copy of your project at [email protected] and I will patch it for you.
Can you prrovide more info in wiki about starting node project in app? About app limitations, possible errors and how to start hevier that small epress eample apps. I believe this will help to prevent a lot of possible questions in the future
I seem to have found a solution by wrapping my code in a try/catch block, and just console.logging/console.error-ing the error out (process.on("unhandledException", ...)
and process.on("unhandledRejection", ...)
did not work).
Though that alone won't work with async code. Instead, I suggest you wrap your whole program in a function, export it, and then use a new entry file like so:
// bootstrap.js
try {
const { myWrappedProgram } = require("./myprogram.js")
const result = myWrappedProgram()
if (result && typeof result === "object" && "then" in result) {
result.then(() => {}, console.error)
}
}
catch (error) {
console.error(error)
}
// myprogram.js
module.exports = { myWrappedProgram }
async function myWrappedProgram() {
// ...
}
// to automatically start when the script is directly run via "node myprogram.js":
if (typeof require !== 'undefined' && require.main === module) {
myWrappedProgram();
}
Now you start like so: node bootstrap.js
.
I think it's actually really silly we have to do this, but until a fix is avaiable, this is better than nothing.
Thanks all for the discussion. While it is not perfect, https://github.com/thebaselab/codeapp/commit/b0c6519b2340743b4afa7f8a968008c1c7eef39e should make uncaught errors reported properly. Additionally, node version is now updated to 18.