Closed danthegoodman1 closed 3 weeks ago
Obviously if you rename it to .cjs it cannot find the file since it looks for that exact file path.
Hi @danthegoodman1 with type: module
you can use export default
instead of module.exports
gotcha, will try that when I revisit sitemapping as I just made my own quickly. Would be great to mention in the docs!
esp since remix templates are all esm by default now
@fedeya My remix app is in a monorepo, and I'm bundling some internal packages when I build the app. When I use export default
in my remix-sitemap.config.js
I get an ESM error:
🔍 Found config file: file:///Users/jamfran/Documents/Projects/myproject/apps/marketing-site/remix-sitemap.config.js
🔍 Generating sitemap...
🔍 Found routes: root, routes/_layout._legal.privacy, routes/_layout._legal.terms, routes/_layout.blog_.$slug, routes/_layout.pricing, routes/_layout._index, routes/_layout._legal, routes/_layout.blog, routes/_layout
/Users/jamfran/Documents/Projects/myproject/packages/ui/src/index.tsx:1
export * from './Accordion'
^^^^^^
SyntaxError: Unexpected token 'export'
Let me know if you have any troubleshooting tips. Thank you!
@fedeya My remix app is in a monorepo, and I'm bundling some internal packages when I build the app. When I use
export default
in myremix-sitemap.config.js
I get an ESM error:🔍 Found config file: file:///Users/jamfran/Documents/Projects/myproject/apps/marketing-site/remix-sitemap.config.js 🔍 Generating sitemap... 🔍 Found routes: root, routes/_layout._legal.privacy, routes/_layout._legal.terms, routes/_layout.blog_.$slug, routes/_layout.pricing, routes/_layout._index, routes/_layout._legal, routes/_layout.blog, routes/_layout /Users/jamfran/Documents/Projects/myproject/packages/ui/src/index.tsx:1 export * from './Accordion' ^^^^^^ SyntaxError: Unexpected token 'export'
Let me know if you have any troubleshooting tips. Thank you!
Just ran into this with turborepo myself. Did you find a solution?
Using export default fixes the issue