Troubleshooting DevLink
This guide covers common issues you might encounter when working with DevLink and provides solutions to help you resolve them.
Authentication and setup issues
API token authentication failures
Issue: DevLink sync fails with authentication errors
Solutions:
- Verify your Webflow API token has the correct permissions
- Check that your token is properly stored in your
.env.local
file - Ensure the token is being accessed correctly in your
.webflowrc.js
/webflow.json
file
Configuration File Location
Issue: The DevLink CLI can’t find your configuration
Solutions:
- Ensure
.webflowrc.js
/webflow.json
is in the root directory of your project - Check that the file has the correct name and extension
- Verify the file has proper JavaScript syntax
@/devlink not found
Many code examples in the DevLink guides reference importing DevLink components from an alias like so:
You can set up your project to import via this alias in various ways once you’ve synced your components. Here are a few examples:
Via tsconfig.json
Update the paths
in the tsconfig.json
file to point to the correct location of your DevLink components.
Via Webpack
Update the resolve.alias
settings in your Webpack configuration to point to the correct location of your DevLink components.
Component sync issues
Missing components
Issue: Some components aren’t exported from Webflow
Solutions:
- Verify the elements are properly converted to Components in Webflow (not just elements on the canvas)
- Check if the components use only supported elements
- Ensure component names don’t contain special characters or spaces
Slot support
Webflow Slot elements are currently not supported with DevLink. However, there is a legacy slot
setting in the DevLink settings panel on each element you can use if you need to add slotted in dynamic content, with the caveat that it doesn’t work the same as the Slot element at this time.
PageLayout example
Consider a PageLayout
component that has a header, footer, and left sidebar built into the component in Webflow, but has the body of the component left open for dynamic content to be passed in as a custom React component. You can create a wrapper <div>
in Webflow and bind it to a slot
property. When using the DevLink-generated component, you can then pass in the React components to fill in the body content.
Sync Process Failures
Issue: The sync process starts but fails to complete
Solutions:
- Check for network connectivity issues
- Verify you’re not exceeding API rate limits
- Try syncing specific components instead of all at once
You can sync a specific component by name:
Styling and rendering issues
Missing Styles
Issue: Components don’t look the same as in Webflow
Solutions:
- Ensure the DevLink
global.css
file is imported at the application root - Verify the
DevLinkProvider
component is wrapping your application at the root - Check for CSS conflicts with other styles in your application
- Inspect the browser console for CSS-related errors
Font Loading Issues
Issue: Custom fonts don’t appear correctly
Solutions:
- Check if the fonts are being loaded from the correct source
- Ensure font imports in
global.css
are loading correctly - Verify fonts aren’t being blocked by CORS policies
- Consider self-hosting the fonts if they’re from external sources
- Make sure font weights and styles match those used in Webflow
Z-index Issues
Issue: Elements appearing behind or in front of others incorrectly
Solutions:
- Check z-index values in the exported CSS
- Inspect stacking contexts in your application
- Adjust z-index values as needed
- Consider using React portals for complex stacking situations
Interaction issues
Interactions Not Working
Issue: Animations or interactions from Webflow don’t work
Solutions:
- Verify the
DevLinkProvider
is properly set up in your application - Check if the interactions use supported features
- Inspect browser console for JavaScript errors
- Consider simplifying complex interactions
Framework-specific issues
Next.js App Router Issues
Issue: DevLink components don’t work with React Server Components
Solutions:
- Add the
"use client"
directive to component files that use client-side features - Import DevLink components only in client components
- Ensure the DevLinkProvider is in a client-side context
Example client component:
Next.js Image Optimization
Issue: Images in DevLink components don’t work with Next.js Image optimization
Solution: Replace DevLink Image elements with Next.js Image components
CSS Conflicts with Tailwind
Issue: DevLink styles conflict with Tailwind CSS
Solutions:
- Use Tailwind’s preflight reset cautiously
- Consider using Tailwind’s
@layer
directive to control specificity - Use more specific selectors for custom styles
- Enable
skipTagSelectors
in your DevLink configuration to prevent conflicts between Tailwind CSS defaults and global.css rules
Some rules from tue DevLink global.css
might conflict with the defaults set by Tailwind CSS. If you wish to use DevLink and Tailwind CSS on the same project, we recommend enabling skipTagSelectors
to disable opinionated rules and selectors and only include the bare minimum required for DevLink components to work.
In your CSS:
In your .webflowrc.js
/ webflow.json
:
When disabling global tags with skipTagSelectors
, make sure that the parent elements of your DevLink components have a defined height/width OR your and
height: 100%;
, especially for components like Navbar and Dropdown that rely on the viewport having sufficient dimensions.CSS Loading Issues
If styles aren’t loading correctly:
- Verify the DevLink
global.css
import path is correct for your framework - Ensure CSS loading is configured correctly in your app
- Check for CSS isolation, scoping, and conflict issues with browser tools
Performance Optimizations
To optimize DevLink components in production:
- Enable code splitting in your framework configuration
- Only import the DevLink components you need from their respective file, rather than importing from the entire
devlink
directory - Consider lazy loading components that aren’t needed on initial render
- Use production builds to minimize JavaScript and CSS
DevLink CLI Issues
CLI Installation Problems
Issue: Issues installing or running the Webflow CLI
Solutions:
- Check Node.js version (v20+ recommended)
- Clear npm cache and try reinstalling
- Ensure you have proper permissions for the installation directory
CLI Command Not Found
Issue: Webflow
command not found after installation
Solutions:
- Ensure the package is installed and up to date
- Use
npx
to run the CLI commands - Add the CLI to your
package.json
scripts
In your package.json:
Then run: