dwmkerr / crosswords-js

Tiny, lightweight crossword control for the web.
https://dwmkerr.github.io/crosswords-js/
MIT License
71 stars 27 forks source link

Error: Cannot find module './compile-crossword' #10

Open diegoqueres opened 3 years ago

diegoqueres commented 3 years ago

When I run the basic example illustrated in the README, the following error appears:

internal/modules/cjs/loader.js:883 throw err; ^

Error: Cannot find module './compile-crossword' Require stack:

hazem-taha commented 2 years ago

m having the same issue, did you mange to fix it ?

dwmkerr commented 2 years ago

Can you share the code you are using to load the crossword?

singh-chandanbir commented 1 month ago

having same issue can anyone suggest a solution......

import React, { useEffect, useRef } from "react"; import Crossword from "crosswords-js";

export default function CrosswordComponent() { const containerRef = useRef(null);

useEffect(() => { const crossword = new Crossword({ rows: 15, cols: 15, cellSize: 35, container: containerRef.current, acrossClues: [], downClues: [], startingPosition: { row: 0, col: 0 }, });

crossword.build();

}, []);

return

; }

Failed to compile.

Module not found: Error: Can't resolve './compile-crossword' in '/Users/chandanbirsingh/Documents/React-app/test-project/node_modules/crosswords-js/src' ERROR in ./node_modules/crosswords-js/src/index.js 1:25-55 Module not found: Error: Can't resolve './compile-crossword' in '/Users/chandanbirsingh/Documents/React-app/test-project/node_modules/crosswords-js/src'

ERROR in ./node_modules/crosswords-js/src/index.js 3:0-28 Module not found: Error: Can't resolve './crosswords.less' in '/Users/chandanbirsingh/Documents/React-app/test-project/node_modules/crosswords-js/src'

webpack compiled with 2 errors