I’m working on creating a custom theme page and I’m running into some persistent issues with linking my CSS and JavaScript assets. I’ve been through a number of troubleshooting steps, and also worked with HubSpot Support, but I’m still stuck.
My Theme Structure: My theme (“Sample Theme”) has the following structure at its root:
- css/
- sample.css
- test-styles.css (created for debugging)
- js/
- sample-one.js
- theme.json
- fields.json
- sample-page.html (my page template)
Error Messages: When I use my sample-page.html template on a page, I’m seeing these errors in the Design Manager validator:
get_asset_url was called, but there is no resource at path css/sample.css (and a similar one for css/test-styles.css when I was testing that).
Previously, I was getting an error like …path null/css/… but that null part seems to have resolved after ensuring the page was created correctly under the active theme. The theme.path debug code now shows a valid path.
When using the full template, the links are: <link rel=“stylesheet” href=“{{ get_asset_url(‘css/sample.css’) }}”> <script src=“{{ get_asset_url(‘js/sample-one.js’) }}”></script>
Troubleshooting Steps Taken
CSS “No Resource” Error (even for test-styles.css):
-
Confirmed the theme (“ZIP Code Insights Theme” and a clone “ZIP Insights Theme Clone”) is active for the domain.
-
Ensured sample-page.html, css/test-styles.css, css/sample.css, and js/sample-one.js are all published (green dots).
-
Verified exact filenames, folder names (all lowercase for css and js), and their locations directly under the theme root.
-
When creating a test page, I explicitly select the correct theme first, then the sample.html template from that theme.
-
The theme.path debug code does show a valid path on the rendered page (e.g., Sample Theme or Sample Theme Clone).
-
Tried recreating css/test-styles.css from scratch (delete, new file, paste simple CSS, publish).
-
The “no resource at path css/test-styles.css” error remains even when theme.path is correctly outputting the theme name.
-
Tried cloning the entire theme and repeating all tests within the cloned theme – the same errors occur.
My Questions:
-
Regarding the CSS get_asset_url “no resource” error: If theme.path is correctly identified on the rendered page, and the file css/test-styles.css definitely exists, is published, and is named correctly within the theme’s css folder, why would HubSpot still report “no resource at path css/test-styles.css”?
I’m at a bit of a loss as to what to try next, especially since the null path issue seems resolved but the files still aren’t found. Any advice or insights would be greatly appreciated!
-