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

Library doesn't work on vercel edge functions due to CSP #1265

Open
owenpearson opened this issue May 16, 2023 · 2 comments
Open

Library doesn't work on vercel edge functions due to CSP #1265

owenpearson opened this issue May 16, 2023 · 2 comments
Labels
enhancement New feature or improved functionality. investigate

Comments

@owenpearson
Copy link
Member

owenpearson commented May 16, 2023

due to using the global object in the core library and letting webpack polyfill it, the ably-js web bundle uses the function constructor which violates the vercel edge functions CSP. one solution would be to make this webpack config change and refactor the core library to avoid global.

┆Issue is synchronized with this Jira Task by Unito

@sync-by-unito
Copy link

sync-by-unito bot commented May 16, 2023

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3581

@owenpearson
Copy link
Member Author

Currently this should suffice as a workaround:

export const config = {
  runtime: 'edge',
  unstable_allowDynamic: [
    '/node_modules/ably/**',
  ]
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality. investigate
Development

No branches or pull requests

2 participants