Parcel throws error when I want to include google app script variable

61 Views Asked by At

I'm trying to pass a variable to html template in app sheet.

I'm trying to use parcel to compile all the code in one html file since app script works like that.

To receive variable in html I would need to use something like this:

<script>
 var doc_id = <?!= doc_id ?>;
</script>

However when I try to compile that I get an error

Build failed.

@parcel/transformer-js: Expression expected

    16 |     <script>
  > 17 |       var doc_id = <?!= doc_id ?>;
  >    |                              ^
    18 |     </script>

Is there a way to make parcel ignore error on some line of code or to fix this in some other way?

0

There are 0 best solutions below