@uniweb/templates 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -264,6 +264,35 @@ Key testing points:
264
264
  - Content sections are in correct order
265
265
  - Handlebars variables are properly substituted
266
266
 
267
+ ## Troubleshooting
268
+
269
+ ### "createRoot" export not found error
270
+
271
+ If you see an error like:
272
+ ```
273
+ The requested module 'react-dom/client.js' does not provide an export named 'createRoot'
274
+ ```
275
+
276
+ This is a Vite CJS/ESM interop issue. **React's npm packages (both 18 and 19) use CommonJS internally**, and Vite needs to pre-bundle them to convert to ESM for the browser.
277
+
278
+ **Solution:** Ensure your `vite.config.js` includes:
279
+
280
+ ```javascript
281
+ export default defineConfig({
282
+ // ... other config
283
+ optimizeDeps: {
284
+ include: ['react', 'react-dom', 'react-dom/client', 'react-router-dom'],
285
+ },
286
+ })
287
+ ```
288
+
289
+ This forces Vite to pre-bundle these packages, ensuring proper CJS→ESM conversion. This is particularly important in:
290
+ - pnpm monorepos with nested `node_modules` structures
291
+ - Projects with linked/workspace dependencies
292
+ - Fresh installs before Vite's dependency discovery runs
293
+
294
+ **Why does React use CommonJS?** React's npm package exports CommonJS for Node.js compatibility. The ESM-only change in React 19 only affects UMD builds (for CDN script tags), not the npm package.
295
+
267
296
  ## Checklist for New Templates
268
297
 
269
298
  - [ ] Create `templates/<name>/template.json` with required `name` field
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/templates",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Template processing engine and official templates for Uniweb",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -24,7 +24,7 @@
24
24
  "url": "git+https://github.com/uniweb/templates.git"
25
25
  },
26
26
  "engines": {
27
- "node": ">=18"
27
+ "node": ">=20.19"
28
28
  },
29
29
  "dependencies": {
30
30
  "handlebars": "^4.7.8"
@@ -21,14 +21,14 @@
21
21
  "react-dom": "^18.0.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@vitejs/plugin-react": "^4.2.1",
24
+ "@vitejs/plugin-react": "^5.0.0",
25
25
  "autoprefixer": "^10.4.18",
26
26
  "postcss": "^8.4.35",
27
27
  "react": "^18.2.0",
28
28
  "react-dom": "^18.2.0",
29
29
  "tailwindcss": "^3.4.1",
30
30
  "uniweb": "^0.2.0",
31
- "vite": "^5.1.0",
31
+ "vite": "^7.0.0",
32
32
  "vite-plugin-svgr": "^4.2.0"
33
33
  }
34
34
  }
@@ -14,7 +14,7 @@
14
14
  "foundation": "file:../foundation"
15
15
  },
16
16
  "devDependencies": {
17
- "@vitejs/plugin-react": "^4.2.1",
17
+ "@vitejs/plugin-react": "^5.0.0",
18
18
  "autoprefixer": "^10.4.18",
19
19
  "js-yaml": "^4.1.0",
20
20
  "postcss": "^8.4.35",
@@ -22,7 +22,7 @@
22
22
  "react-dom": "^18.2.0",
23
23
  "react-router-dom": "^6.22.0",
24
24
  "tailwindcss": "^3.4.1",
25
- "vite": "^5.1.0",
25
+ "vite": "^7.0.0",
26
26
  "vite-plugin-svgr": "^4.2.0"
27
27
  }
28
28
  }