Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest update results in UserCodeSyntaxError #127

Closed
tkadlec opened this issue Sep 4, 2024 · 1 comment
Closed

Latest update results in UserCodeSyntaxError #127

tkadlec opened this issue Sep 4, 2024 · 1 comment

Comments

@tkadlec
Copy link

tkadlec commented Sep 4, 2024

I opened a thread in Discord too, but putting it here for posterity.

I think the latest update (88d742b) is the root cause of a "Runtime.UserCodeSyntaxError" currently taking down my app.

Here's the exact error:

{
    "errorType": "Runtime.UserCodeSyntaxError",
    "errorMessage": "SyntaxError: Named export 'pathToRegexp' not found. The requested module 'path-to-regexp' is a CommonJS module, which may not support all module.exports as named exports.\nCommonJS modules can always be imported via the default export, for example using:\n\nimport pkg from 'path-to-regexp';\nconst { pathToRegexp } = pkg;\n",
    "stack": [
        "Runtime.UserCodeSyntaxError: SyntaxError: Named export 'pathToRegexp' not found. The requested module 'path-to-regexp' is a CommonJS module, which may not support all module.exports as named exports.",
        "CommonJS modules can always be imported via the default export, for example using:",
        "",
        "import pkg from 'path-to-regexp';",
        "const { pathToRegexp } = pkg;",
        "",
        "    at _loadUserApp (file:///var/runtime/index.mjs:1084:17)",
        "    at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)",
        "    at async start (file:///var/runtime/index.mjs:1282:23)",
        "    at async file:///var/runtime/index.mjs:1288:1"
    ]
}

Let me know if there are any other helpful details I can provide to help you dive in.

@tkadlec
Copy link
Author

tkadlec commented Sep 4, 2024

Closing this. The change was the fix, not the cause.

If anyone stumbles on this, upgrade arc-plugin-enhance to 11.0.4.

@tkadlec tkadlec closed this as completed Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant