N
Nuxt5w ago
freb97

Rollup Plugin Inject Problem building Docus app within a Bun monorepo

I am having a problem with the Nuxt build failing after rollup-plugin-inject fails to transform some files from docus while building the application. Has anyone had this problem before? The failed CI run can be seen here: https://github.com/nuxt-modules/shopify/actions/runs/18998854241/job/54262607900 What seems to start it is this:
nuxt-shopify-docs build: [warn] [plugin inject] ../node_modules/.bun/docus@5.2.1+b203761f41787723/node_modules/docus/server/routes/raw/[...slug].md.get.ts: rollup-plugin-inject: failed to parse /home/runner/work/shopify/shopify/node_modules/.bun/docus@5.2.1+b203761f41787723/node_modules/docus/server/routes/raw/[...slug].md.get.ts. Consider restricting the plugin to particular files via options.include
nuxt-shopify-docs build: [warn] [plugin inject] ../node_modules/.bun/docus@5.2.1+b203761f41787723/node_modules/docus/server/routes/raw/[...slug].md.get.ts: rollup-plugin-inject: failed to parse /home/runner/work/shopify/shopify/node_modules/.bun/docus@5.2.1+b203761f41787723/node_modules/docus/server/routes/raw/[...slug].md.get.ts. Consider restricting the plugin to particular files via options.include
Thanks in advance!
GitHub
chore(template): add tailwindcss dependency · nuxt-modules/shopify...
🚀 Easily integrate Shopify into your Nuxt app. Contribute to nuxt-modules/shopify development by creating an account on GitHub.
11 Replies
kapa.ai
kapa.ai5w ago
Hi @freb97. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources provided do not contain specific information about issues with rollup-plugin-inject failing to transform files from Docus when building a Nuxt app within a Bun monorepo. There are no explicit references to Docus, Bun, or rollup-plugin-inject in the context of this error in the available documents. However, there are some general troubleshooting tips for Rollup and plugin-related issues in Nuxt: - If you encounter errors related to Rollup plugins not handling certain file types, it is often necessary to configure the plugin's include/exclude options to restrict which files it processes. This is hinted at in your error message and is a common Rollup practice. - For issues with ESM/CJS interop or plugin compatibility, Nuxt documentation suggests using build.transpile or alias in your nuxt.config to work around problematic dependencies, but this is more about module format issues than plugin transformation errors Nuxt 3 ESM Troubleshooting. - If you are using experimental or less common build tools (like Bun), you may encounter compatibility issues that are not present with Node.js, as some plugins or modules may not fully support alternative runtimes. Since your issue is specific to Docus, rollup-plugin-inject, and Bun, and none of these are directly addressed in the knowledge sources, I recommend raising the issue with the maintainers of Docus or Nuxt, providing them with the error details and your build environment for more targeted support. If you have more details or logs, or if the problem is reproducible with a minimal setup, sharing that with the Nuxt or Docus community may help get a more precise answer. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5w ago
<@552257564667019275> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
freb97
freb97OP5w ago
@kapa.ai Take a look at my nuxt.config.ts:
export default defineNuxtConfig({
extends: ['docus'],

...

runtimeConfig: {
shopify: {
name: 'nuxt-shopify-docs',

clients: {
storefront: {
apiVersion: '',
proxy: false,
mock: true,
},
},
},
},

vite: {
build: {
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('vaul-vue')) return 'vaul-vue'
if (id.includes('reka-ui')) return 'reka-ui'
},
},
},
},
optimizeDeps: {
include: ['vaul-vue', 'reka-ui'],
},
},

...
})
export default defineNuxtConfig({
extends: ['docus'],

...

runtimeConfig: {
shopify: {
name: 'nuxt-shopify-docs',

clients: {
storefront: {
apiVersion: '',
proxy: false,
mock: true,
},
},
},
},

vite: {
build: {
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('vaul-vue')) return 'vaul-vue'
if (id.includes('reka-ui')) return 'reka-ui'
},
},
},
},
optimizeDeps: {
include: ['vaul-vue', 'reka-ui'],
},
},

...
})
Could any of this cause the problems?
kapa.ai
kapa.ai5w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Based on the knowledge sources provided, there is no explicit mention of issues caused by the specific nuxt.config.ts settings you shared—especially in relation to rollup-plugin-inject or Docus. However, I can provide some context on the relevant configuration options: - vite.build.rollupOptions.output.manualChunks: This is a standard way to customize chunk splitting in Vite/Rollup and is supported in Nuxt's Vite integration Nuxt 4.x Vite config. - vite.optimizeDeps.include: This is also a supported option and is used to pre-bundle dependencies for faster dev server startup. The documentation notes that optimizeDeps only applies to the client environment and should not be set for the server Nuxt 4.x Vite config, Vite environment API issue. There is a known issue where Vite's optimizeDeps configuration is not inherited by environments and must be set explicitly for the client. Nuxt has addressed this in recent updates to avoid errors like "The entry point 'ufo' cannot be marked as external" Nuxt Vite optimizeDeps fix, Vite environment API issue. However, your config appears to follow the documented approach. Regarding rollup-plugin-inject:
The knowledge sources do not mention rollup-plugin-inject or its interaction with Docus or Bun. The error message you shared suggests that the plugin is trying to process files it shouldn't, and the warning itself recommends restricting the plugin to particular files via options.include. This is a Rollup-specific issue and not directly related to the Nuxt config options shown. Summary:
From the documentation, your nuxt.config.ts settings for vite.build.rollupOptions and vite.optimizeDeps are valid and should not, by themselves, cause the rollup-plugin-inject error. The knowledge sources do not provide enough information to confirm if these settings are the root cause of your problem. The issue is more likely related to how rollup-plugin-inject is configured or how it interacts with Docus and Bun, which is not covered in the provided sources. If you continue to experience issues, consider checking the configuration of rollup-plugin-inject or restricting its scope as suggested in the error message. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5w ago
<@552257564667019275> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
freb97
freb97OP5w ago
@kapa.ai Adjust my nuxt.config.ts please, so that the rollup inject plugin excludes the file that throws the warning
kapa.ai
kapa.ai5w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- I'm sorry, but the knowledge sources provided do not contain information or examples on how to configure the rollup-plugin-inject specifically within a Nuxt project's nuxt.config.ts, nor do they show how to exclude files from this plugin in the context of Nuxt or Docus. The documentation covers how to add and configure Vite plugins in Nuxt, but does not address the use or configuration of rollup-plugin-inject or its exclude/include options in this environment Using Vite Plugins in Nuxt. Because of this, I cannot provide a Nuxt-specific, source-backed code example for excluding a file from rollup-plugin-inject in your nuxt.config.ts. If you need to proceed, I recommend consulting the official Vite plugin documentation or the rollup-plugin-inject documentation for general usage, and then adapting it to Nuxt as described in the Nuxt Vite plugin integration guide. If you have further questions or more context, please provide additional details or consult the Nuxt or Docus community for more targeted support. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5w ago
<@552257564667019275> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
freb97
freb97OP5w ago
@kapa.ai For your knowledge base: It was a problem with a Bun feature called "Isolated installs", which was recently added with Bun v1.2 and is active by default since 1.3. Deactivating it by running bun install --linker hoisted solved it.
kapa.ai
kapa.ai5w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Thank you for sharing this information! Based on the knowledge sources provided, there is no mention of Bun's "Isolated installs" feature or its impact on Nuxt, Docus, or rollup-plugin-inject. The knowledge sources do not contain enough information to confirm or elaborate on this specific issue or its resolution. Your finding—that disabling Bun's "Isolated installs" by running bun install --linker hoisted resolves the problem—is not documented in the sources above. If others encounter similar issues, this insight could be valuable, but it is not currently reflected in the official Nuxt or Docus documentation or issue trackers included in the knowledge base. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5w ago
<@552257564667019275> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?