b3ross / dotenvi

A simple library for generating dotenv files
MIT License
17 stars 7 forks source link

Strings with curly braces cause memory error #42

Closed lk-jeffpeck closed 4 years ago

lk-jeffpeck commented 4 years ago

env.yaml:

default_env: &default_env
  TEST_TPL: "a string with {something} in curly brackets"
❯ dotenvi -s default_env

runs for a while and then:

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
b3ross commented 4 years ago

This is almost definitely failing somewhere here:https://github.com/b3ross/dotenvi/blob/master/src/rewriter.ts#L25

We should probably add some state there to check whether we were actually capturing something.

We should also add a test here: https://github.com/b3ross/dotenvi/blob/master/src/rewriter.test.js

b3ross commented 4 years ago

I think I have a fix in place - will merge after https://github.com/b3ross/dotenvi/pull/50 is merged down.