mintproject / mic-web

0 stars 0 forks source link

Error in build #5

Closed dgarijo closed 2 years ago

dgarijo commented 3 years ago

Hi, I was trying this, and I got an error.

Steps to reproduce:

  1. git clone https://github.com/mintproject/mic-web.git
  2. cd mic-web
  3. docker-compose up -d

Trace:

FAIL src/App.test.tsx
  ● Test suite failed to run

    Jest encountered an unexpected token

    This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

    By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/en/ecmascript-modules for how to enable it.
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/en/configuration.html

    Details:

    /app/node_modules/xterm-for-react/dist/bundle.js:14
    */var i=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function s(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,a,c=s(e),l=1;l<arguments.length;l++){for(var h in r=Object(arguments[l]))n.call(r,h)&&(c[h]=r[h]);if(i){a=i(r);for(var u=0;u<a.length;u++)o.call(r,a[u])&&(c[a[u]]=r[a[u]])}}return c}},function(e,t,r){"use strict";var i=r(65);function n(){}fu

    SyntaxError: Unexpected token export

      1 | import React, { useEffect, useRef, useState } from "react";
    > 2 | import { XTerm } from "xterm-for-react";
        | ^
      3 | import io from "socket.io-client";
      4 | import "./terminal.css";
      5 |

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14)
      at Object.<anonymous> (src/components/Terminal.tsx:2:1)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1.515 s
Ran all test suites.
(node:26) ExperimentalWarning: The fs.promises API is experimental
npm ERR! Test failed.  See above for more details.
The command '/bin/sh -c CI=true npm test' returned a non-zero code: 1
ERROR: Service 'frontend' failed to build
dgarijo commented 3 years ago

Maybe I am not deploying some requirements? Since it had a docker compose, I assumed the file would do everything

mosoriob commented 2 years ago

Hi Daniel, I didn't see the notifications. The previous instructions were incorrect and incomplete but I have updated them. You can see a live demo at micweb.netlify.app/