masroorejaz / react-simple-captcha

A very simple and powerful captcha for ReactJS
39 stars 18 forks source link

Cannot use import statement outside a module #34

Open brookerose1312 opened 6 months ago

brookerose1312 commented 6 months ago

Using react-remix, attempting to run locally I receive this issue:

import { Component } from 'react';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1033:15)
    at Module._compile (node:internal/modules/cjs/loader:1069:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:827:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/brooke/Personal Projects/remix-website/build/index.js:113:168)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "dev:server" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This should be solvable by making the package.json contain {"type": "module"} but I'm not sure if that will fix this.

Mudassarali222 commented 6 months ago

i am faceing same issue...

its-dev-yogesh commented 3 months ago

1+