Coder Social home page Coder Social logo

Comments (8)

edi9999 avatar edi9999 commented on September 26, 2024

Hello @RichieRock,

Thanks for pointing that out, this is now fixed in version 3.37.4 of docxtemplater !

If you really liked our support, you could record us a video testimonal for our
site.

The video can last between 30 seconds to 90 seconds.

If you are ok with that, simply follow the following link to do the
recording :

https://testimonial.to/docxtemplater

from docxtemplater.

RichieRock avatar RichieRock commented on September 26, 2024

Hi! Thank you for your reply and for the fix!

I installed [email protected] but I'm facing another issue.

Cannot find module 'docxtemplater/text' from 'my_file.test.ts'

      1 | import angularParser from 'docxtemplater/expressions'
    > 2 | import TxtTemplater from 'docxtemplater/text'`

at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)

Any idea why am I getting this error? That's the error when running a test file with jest. But also, when using TXTTemplater from a regular .ts node file (my environment it's Azure Functions), I also get similar error:

Worker was unable to load function GetUserData: 'Cannot find module 'docxtemplater/text'

Worth mentioning that I did not have these issues when using the angularparser import. Something must be different this time. Perhaps something about it being a class instead of a variable?

from docxtemplater.

edi9999 avatar edi9999 commented on September 26, 2024

I think it should be

import TxtTemplater from 'docxtemplater/js/text.js';

from docxtemplater.

RichieRock avatar RichieRock commented on September 26, 2024

Hmm, interesting. It does work with that /js/ import. However it is weird since vscode approved, and in fact suggested this import:

import TxtTemplater from 'docxtemplater/text'

But the node module resolver didn't like that import.

Also, worth mentioning that it works nicely with

import angularParser from 'docxtemplater/expressions'

Which looks cleaner way to import stuff.

Anyway, I guess I'll use the /js/ version instead :)

from docxtemplater.

edi9999 avatar edi9999 commented on September 26, 2024
import TxtTemplater from 'docxtemplater/text'

is now possible since v3.37.5 !

from docxtemplater.

RichieRock avatar RichieRock commented on September 26, 2024

Thanks!

Unfortunately I'm still facing issues with v3.37.5:

    Cannot find module './lexer.js' from 'node_modules/docxtemplater/text.js'

    Require stack:
      node_modules/docxtemplater/text.js
      GenerateOfferLetter/OfferLetterGenerator.test.ts

      1 | import angularParser from 'docxtemplater/expressions'
    > 2 | import TxtTemplater from 'docxtemplater/text'

from docxtemplater.

edi9999 avatar edi9999 commented on September 26, 2024

Hello, this should now be fixed in v3.37.6

from docxtemplater.

RichieRock avatar RichieRock commented on September 26, 2024

Thank you @edi9999 ! Works now :)

from docxtemplater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.